Exemplo n.º 1
0
 def test_process_item(self, mock_symlink):
     step = steps.PublishContentStep(working_dir='/foo/bar')
     test_unit = Unit(constants.DEB_TYPE_ID, {},
                      {'file_name': 'apples.deb'},
                      storage_path='/some/random/apples.deb')
     step.process_main(item=test_unit)
     mock_symlink.assert_called_once_with('/some/random/apples.deb',
                                          '/foo/bar/apples.deb')
Exemplo n.º 2
0
 def test_get_total(self):
     step = steps.PublishContentStep()
     step.repo = Mock(content_unit_counts={constants.DEB_TYPE_ID: 10})
     self.assertEquals(10, step._get_total())
Exemplo n.º 3
0
 def test_initialize(self, mock_makedirs):
     step = steps.PublishContentStep(working_dir='/foo/bar')
     step.initialize()
     mock_makedirs.assert_called_once_with('/foo/bar')
Exemplo n.º 4
0
 def test_get_iterator(self):
     step = steps.PublishContentStep()
     step.conduit = Mock()
     return_value = step.get_iterator()
     self.assertEquals(return_value, step.conduit.get_units.return_value)
Exemplo n.º 5
0
 def test_process_main(self):
     step = steps.PublishContentStep()
     self.parent.add_child(step)
     step.process_main()