コード例 #1
0
 def test_no_env(self):
     client = API()
     config = client._conf()
     self.assertEqual(config['email'], '*****@*****.**')
     self.assertEqual(config['key'], 'your_api_key')
     self.assertEqual(config['url'], 'https://<server>')
     self.assertEqual(client.verify_ssl, True)
コード例 #2
0
 def test_url_env(self):
     url = 'https://example.com'
     os.environ['TESTRAIL_URL'] = url
     client = API()
     config = client._conf()
     self.assertEqual(config['email'], '*****@*****.**')
     self.assertEqual(config['key'], 'your_api_key')
     self.assertEqual(config['url'], url)
コード例 #3
0
 def test_key_env(self):
     key = 'itgiwiht84inf92GWT'
     os.environ['TESTRAIL_USER_KEY'] = key
     client = API()
     config = client._conf()
     self.assertEqual(config['email'], '*****@*****.**')
     self.assertEqual(config['key'], key)
     self.assertEqual(config['url'], 'https://<server>')
コード例 #4
0
 def test_user_env(self):
     email = '*****@*****.**'
     os.environ['TESTRAIL_USER_EMAIL'] = email
     client = API()
     config = client._conf()
     self.assertEqual(config['email'], email)
     self.assertEqual(config['key'], 'your_api_key')
     self.assertEqual(config['url'], 'https://<server>')
コード例 #5
0
 def test_no_config_file(self):
     os.remove(self.config_path)
     key = 'itgiwiht84inf92GWT'
     email = '*****@*****.**'
     url = 'https://example.com'
     os.environ['TESTRAIL_URL'] = url
     os.environ['TESTRAIL_USER_KEY'] = key
     os.environ['TESTRAIL_USER_EMAIL'] = email
     client = API()
     config = client._conf()
     self.assertEqual(config['url'], url)
     self.assertEqual(config['key'], key)
     self.assertEqual(config['email'], email)
     self.assertEqual(client.verify_ssl, True)