test_kog.py 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. # Copyright (c) 2012-2013 LiuYC https://github.com/liuyichen/
  2. # Copyright 2012-2014 ksyun.com, Inc. or its affiliates. All Rights Reserved.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License"). You
  5. # may not use this file except in compliance with the License. A copy of
  6. # the License is located at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # or in the "license" file accompanying this file. This file is
  11. # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
  12. # ANY KIND, either express or implied. See the License for the specific
  13. # language governing permissions and limitations under the License.
  14. import os
  15. from tests import unittest
  16. import mock
  17. import kscore.session
  18. class TestGameTestService(unittest.TestCase):
  19. def setUp(self):
  20. self.environ = os.environ.copy()
  21. self.patched = mock.patch('os.environ', self.environ)
  22. self.patched.start()
  23. self.environ.pop('KS_DATA_PATH', None)
  24. self.session = kscore.session.get_session()
  25. self.client = self.session.create_client("kog")
  26. def tearDown(self):
  27. self.patched.stop()
  28. def test_project_list(self):
  29. self.assertTrue(isinstance(self.client.get_project_list(), list))