Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added test to ensure arguments overwrote config file passed in args.

  • Loading branch information...
commit e0eb7aea420a1d2cf34d962e3fc62def7d02fdbd 1 parent 4cd415d
Paddy Foran paddyforan authored

Showing 1 changed file with 28 additions and 0 deletions. Show diff stats Hide diff stats

  1. +28 0 test.py
28 test.py
@@ -167,6 +167,34 @@ def test_fromArgsConfigFileMixed(self):
167 167
168 168 os.remove("test_config.json")
169 169
  170 + def test_fromArgsAndArgsConfigFile(self):
  171 + test_config = {
  172 + "host": "test-config-host",
  173 + "protocol": "test-config-protocol",
  174 + "port": "test-config-port",
  175 + "api_version": "test-config-api-version",
  176 + "project_id": "test-config-project-id",
  177 + "token": "test-config-token"
  178 + }
  179 +
  180 + file = open("test_config.json", "w")
  181 + file.write(json.dumps(test_config))
  182 + file.close()
  183 +
  184 + client = iron_core.IronClient(name="Test", version="0.1.0",
  185 + product="iron_worker", config_file="test_config.json",
  186 + project_id="test-project-id-args",
  187 + token="test-token-args")
  188 +
  189 + self.assertEqual(client.host, test_config["host"])
  190 + self.assertEqual(client.protocol, test_config["protocol"])
  191 + self.assertEqual(client.port, test_config["port"])
  192 + self.assertEqual(client.api_version, test_config["api_version"])
  193 + self.assertEqual(client.project_id, "test-project-id-args")
  194 + self.assertEqual(client.token, "test-token-args")
  195 +
  196 + os.remove("test_config.json")
  197 +
170 198
171 199 if __name__ == "__main__":
172 200 unittest.main()

0 comments on commit e0eb7ae

Please sign in to comment.
Something went wrong with that request. Please try again.