MCPcopy Index your code
hub / github.com/aws/aws-cli / setUp

Method setUp

tests/unit/test_clidocs.py:575–593  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

573
574class TestTopicDocumentEventHandlerBase(unittest.TestCase):
575 def setUp(self):
576 self.session = mock.Mock()
577 self.file_creator = FileCreator()
578
579 self.tags_dict = {}
580
581 # Make a temporary json index to base information on
582 self.json_index = self.file_creator.create_file('index.json', '')
583 with open(self.json_index, 'w') as f:
584 json.dump(self.tags_dict, f, indent=4, sort_keys=True)
585
586 self.index_patch = mock.patch(
587 'awscli.topictags.TopicTagDB.index_file', self.json_index
588 )
589 self.dir_patch = mock.patch(
590 'awscli.topictags.TopicTagDB.topic_dir', self.file_creator.rootdir
591 )
592 self.index_patch.start()
593 self.dir_patch.start()
594
595 def tearDown(self):
596 self.dir_patch.stop()

Callers

nothing calls this directly

Calls 4

FileCreatorClass · 0.90
create_fileMethod · 0.45
dumpMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected