Skip to content

Commit

Permalink
v0.41 that enabled new unitises and fixes #44
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea committed Mar 6, 2015
1 parent 0195cad commit db5ce73
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
2 changes: 1 addition & 1 deletion jira/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ def add_attachment(self, issue, attachment, filename=None):
url,
files={
'file': (fname, attachment, 'application/octet-stream')},
headers=CaseInsensitiveDict({'content-type': None}))
headers=CaseInsensitiveDict({'content-type': None, 'X-Atlassian-Token': 'nocheck'}))
else:
method = 'MultipartEncoder'

Expand Down
2 changes: 1 addition & 1 deletion jira/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
# 1) we don't load dependencies by storing it in __init__.py
# 2) we can import it in setup.py for the same reason
# 3) we can import it into the jira module
__version__ = '0.40'
__version__ = '0.41'
30 changes: 16 additions & 14 deletions tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,15 +386,22 @@ def test_application_property(self):
key='jira.lf.text.headingcolour')
self.assertEqual(clone_prefix['value'], '#292929')

@unittest.skip("may fail to to running test concurrentlym")
def test_set_application_property(self):
prop = 'jira.lf.favicon.hires.url'
self.jira.set_application_property(prop, '/Tjira-favicon-hires.png')
self.assertEqual(self.jira.application_properties(key=prop)['value'],
'/Tjira-favicon-hires.png')
self.jira.set_application_property(prop, '/jira-favicon-hires.png')
self.assertEqual(self.jira.application_properties(key=prop)['value'],
'/jira-favicon-hires.png')
valid_value = '/jira-favicon-hires.png'
invalud_value = '/Tjira-favicon-hires.png'
counter = 0

while self.jira.application_properties(key=prop)['value'] != valid_value and conter < 3:
if counter:
sleep(10)
self.jira.set_application_property(prop, invalid_value)
self.assertEqual(self.jira.application_properties(key=prop)['value'],
invalid_value)
self.jira.set_application_property(prop, valid_value)
self.assertEqual(self.jira.application_properties(key=prop)['value'],
valid_value)
counter += 1

def test_setting_bad_property_raises(self):
prop = 'random.nonexistent.property'
Expand Down Expand Up @@ -1748,17 +1755,12 @@ def test_session_with_no_logged_in_user_raises(self):
anon_jira = JIRA('https://support.atlassian.com', logging=False)
self.assertRaises(JIRAError, anon_jira.session)

@unittest.skip("Returns AttributeError instead of ConnectionError due to serverInfo usage.")
def test_session_server_offline(self):
try:
JIRA('https://127.0.0.1:1', logging=False)
except Exception as e:
self.assertEqual(type(e), ConnectionError)

#@unittest.expectedFailure
# def test_kill_session(self):
# self.jira.kill_session()
# self.jira.session()
logging.error(e)
self.assertEqual(type(e), JIRAError)


class WebsudoTests(unittest.TestCase):
Expand Down

0 comments on commit db5ce73

Please sign in to comment.