Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PyOTRS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coopdevs
Som Connexió
OTRS
PyOTRS
Commits
cdf3baf9
Commit
cdf3baf9
authored
8 years ago
by
Robert Habermann
Browse files
Options
Downloads
Patches
Plain Diff
extend tests
parent
7aa80fae
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
pyotrs/lib.py
+0
-104
0 additions, 104 deletions
pyotrs/lib.py
pyotrs/version.py
+1
-1
1 addition, 1 deletion
pyotrs/version.py
tests/test_pyotrs_responses.py
+0
-25
0 additions, 25 deletions
tests/test_pyotrs_responses.py
tox.ini
+13
-0
13 additions, 0 deletions
tox.ini
with
14 additions
and
130 deletions
pyotrs/lib.py
+
0
−
104
View file @
cdf3baf9
...
...
@@ -196,58 +196,6 @@ class Attachment(object):
"""
return
Attachment
(
"
YmFyCg==
"
,
"
text/plain
"
,
"
dümmy.txt
"
)
#
# class AttachmentList(object):
# """PyOTRS Attachment class """
# def __init__(self, attachments=None):
# attachment_list = []
# if isinstance(attachments, Attachment):
# attachment_list.append(attachments)
# elif isinstance(attachments, list):
# for item in attachments:
# attachment_list.append(item)
#
# self.attachment_list = attachment_list
#
# def __iter__(self):
# for item in self.attachment_list:
# yield item
#
# def __repr__(self):
# return "<{0}: {1} item(s)>".format(self.__class__.__name__, len(self.attachment_list))
#
# def add(self, attachment):
# """add Attachment to AttachmentList
#
# Args:
# attachment:
#
# Returns:
#
# """
# self.attachment_list.append(attachment)
#
# def to_dct(self):
# """represent AttachmentList and related Attachment objects as dict
#
# Returns:
#
# """
# _lst = []
# for attachments in self:
# _lst.append(attachments.__dict__)
# return {"Attachment": _lst}
#
# @classmethod
# def dummy(cls):
# """dummy data (for testing)
#
# Returns:
#
# """
# return AttachmentList(Attachment.dummy())
class
DynamicField
(
object
):
"""
PyOTRS DynamicField class
"""
...
...
@@ -293,58 +241,6 @@ class DynamicField(object):
"""
return
DynamicField
(
dct
=
{
'
Name
'
:
'
lastname
'
,
'
Value
'
:
'
Doe
'
})
#
# class DynamicFieldList(object):
# """PyOTRS DynamicFieldList class """
# def __init__(self, dynamic_field_dicts=None):
# dynamic_field_list = []
# if isinstance(dynamic_field_dicts, DynamicField):
# dynamic_field_list.append(dynamic_field_dicts)
# elif isinstance(dynamic_field_dicts, list):
# for item in dynamic_field_dicts:
# dynamic_field_list.append(item)
#
# self.dynamic_field_list = dynamic_field_list
#
# def __iter__(self):
# for item in self.dynamic_field_list:
# yield item
#
# def __repr__(self):
# return "<{0}: {1} item(s)>".format(self.__class__.__name__, len(self.dynamic_field_list))
#
# def add(self, dynamic_field):
# """add DynamicField object to DynamicFieldList
#
# Args:
# dynamic_field (DynamicField):
#
# Returns:
#
# """
# self.dynamic_field_list.append(dynamic_field)
#
# def to_dct(self):
# """represent DynamicFieldList and related DynamicField objects as dict
#
# Returns:
# """
# _lst = []
# for dynamic_field in self:
# _lst.append(dynamic_field.to_dct())
# return {"DynamicField": _lst}
#
# @classmethod
# def dummy(cls):
# """dummy data (for testing)
#
# Returns:
#
# """
# return DynamicFieldList([DynamicField(name="firstname", value="Jane"),
# DynamicField(dct={'Name': 'lastname', 'Value': 'Doe'})])
class
Ticket
(
object
):
"""
PyOTRS Ticket class
"""
...
...
This diff is collapsed.
Click to expand it.
pyotrs/version.py
+
1
−
1
View file @
cdf3baf9
...
...
@@ -4,5 +4,5 @@
# 3) we can import it into your module module
"""
__version_info__
=
(
'
0
'
,
'
4
'
,
'
0
'
)
__version_info__
=
(
'
0
'
,
'
5
'
,
'
0
'
)
__version__
=
'
.
'
.
join
(
__version_info__
)
This diff is collapsed.
Click to expand it.
tests/test_pyotrs_responses.py
+
0
−
25
View file @
cdf3baf9
...
...
@@ -362,31 +362,6 @@ class PyOTRSResponsesTests(unittest.TestCase):
self
.
assertEqual
(
obj
.
operation
,
'
TicketUpdate
'
)
self
.
assertEqual
(
mock_validate_resp
.
call_count
,
1
)
"""
def test_my_api_mocked(self):
with responses.RequestsMock() as rsps:
rsps.add(responses.GET,
'
http://localhost
'
,
body=
'
{}
'
,
status=302,
content_type=
'
text/html
'
)
rsps.add(responses.GET,
'
https://localhost
'
,
body=
'
This is Sparta
'
,
status=200,
content_type=
'
text/html
'
)
requests.get(
'
http://localhost
'
)
resp = requests.get(
'
https://localhost
'
)
print(resp.content)
# self.assertEqual(resp.status_code, 200)
def test_my_api_real(self):
# outside the context manager requests will hit the remote server
resp = requests.get(
'
http://localhost
'
)
self.assertEqual(resp.status_code, 200)
"""
# Main
def
main
():
...
...
This diff is collapsed.
Click to expand it.
tox.ini
+
13
−
0
View file @
cdf3baf9
...
...
@@ -82,6 +82,19 @@ whitelist_externals =
commands
=
sudo
cp
-a
{toxinidir}/htmlcov
/var/www/PyOTRS/
# --------------------------------------------------------------------
# Lint
# --------------------------------------------------------------------
[testenv:wheel]
skip_install
=
True
commands
=
python setup.py bdist_wheel
[testenv:sdist]
skip_install
=
True
commands
=
python setup.py sdist
# --------------------------------------------------------------------
# Lint
# --------------------------------------------------------------------
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment