| 581 | |
| 582 | class CLITokenCachingTestCase(unittest.TestCase): |
| 583 | def setUp(self): |
| 584 | super(CLITokenCachingTestCase, self).setUp() |
| 585 | self._mock_temp_dir_path = tempfile.mkdtemp() |
| 586 | self._mock_config_directory_path = os.path.join( |
| 587 | self._mock_temp_dir_path, "testconfig" |
| 588 | ) |
| 589 | self._mock_config_path = os.path.join( |
| 590 | self._mock_config_directory_path, "config" |
| 591 | ) |
| 592 | |
| 593 | os.makedirs(self._mock_config_directory_path) |
| 594 | |
| 595 | self._p1 = mock.patch( |
| 596 | "st2client.base.ST2_CONFIG_DIRECTORY", self._mock_config_directory_path |
| 597 | ) |
| 598 | self._p2 = mock.patch("st2client.base.ST2_CONFIG_PATH", self._mock_config_path) |
| 599 | self._p1.start() |
| 600 | self._p2.start() |
| 601 | |
| 602 | def tearDown(self): |
| 603 | super(CLITokenCachingTestCase, self).tearDown() |