def setUp(self): # Create a temporary mock working copy self.cwd = os.getcwd() self.temp = tempfile.mkdtemp() os.chdir(self.temp) common.touch('.mockvcs') # Create default document attributes self.prefix = 'PREFIX' self.root = self.temp self.path = os.path.join(self.root, 'DIRECTORY') self.parent = 'PARENT_PREFIX' # Create default item attributes self.uid = 'PREFIX-00042' # Load an actual document self.document = core.Document(FILES, root=ROOT) # Ensure the tree is reloaded _clear_tree()
def setUp(self): """Reset the internal tree.""" _clear_tree()
def test_find_item(self, mock_find_item): # pylint: disable=R0201 """Verify items can be found using a convenience function.""" _clear_tree() uid = 'req1' find_item(uid) mock_find_item.assert_called_once_with(uid)
def test_find_document(self, mock_find_document): # pylint: disable=R0201 """Verify documents can be found using a convenience function.""" _clear_tree() prefix = 'req' find_document(prefix) mock_find_document.assert_called_once_with(prefix)
def setUp(self): super().setUp() os.chdir(self.temp) common.touch('.mockvcs') _clear_tree()