def test_empty_dagda_port_exit_1(self): os.environ['DAGDA_HOST'] = str('localhost') try: del os.environ['DAGDA_PORT'] except KeyError: pass with self.assertRaises(SystemExit) as cm: _get_dagda_base_url() self.assertEqual(cm.exception.code, 1)
def test_with_dagda_host_and_port(self): os.environ['DAGDA_HOST'] = str('localhost') os.environ['DAGDA_PORT'] = str('50000') self.assertEqual(_get_dagda_base_url(), 'http://localhost:50000/v1')