Skip to content
Snippets Groups Projects
Commit cdf3baf9 authored by Robert Habermann's avatar Robert Habermann
Browse files

extend tests

parent 7aa80fae
No related branches found
No related tags found
No related merge requests found
......@@ -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 """
......
......@@ -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__)
......@@ -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():
......
......@@ -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
# --------------------------------------------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment