for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
from build_job import BuildJobAction
from teamcity_base_test_case import TeamCityBaseActionTestCase
class BuildJobActionTestCase(TeamCityBaseActionTestCase):
__test__ = True
action_cls = BuildJobAction
def test_run_api_404(self):
action, adapter = self._get_action_status_code(
'POST',
"mock://example.teamcityagent.com:8080/httpAuth/rest/buildQueue",
status_code=404)
self.assertRaises(ValueError, action.run, "test", "testbranch")
def test_run_api_success(self):
expected = self.load_json("build_job.json")
action, adapter = self.__get_mocked_action()
adapter.register_uri('POST',
text=self.get_fixture_content("build_job,json"))
result = action.run("test", "testbranch")
self.assertEqual(result, expected)