Example #1
0
 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()
Example #2
0
 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()
Example #3
0
 def setUp(self):
     """Reset the internal tree."""
     _clear_tree()
Example #4
0
 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)
Example #5
0
 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)
Example #6
0
 def setUp(self):
     """Reset the internal tree."""
     _clear_tree()
Example #7
0
 def setUp(self):
     super().setUp()
     os.chdir(self.temp)
     common.touch('.mockvcs')
     _clear_tree()
Example #8
0
 def setUp(self):
     super().setUp()
     os.chdir(self.temp)
     common.touch('.mockvcs')
     _clear_tree()
Example #9
0
 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)
Example #10
0
 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)