Exemplo n.º 1
0
    def test_ziprename(self):

        def mock_glob(something):
            return ['something.zip']

        with mock.patch('subprocess.call'):
            with mock.patch('glob.glob', mock_glob):
                with mock.patch('shutil.copy') as mocked:
                    create_zipfile({'version': '1.0',
                         'workingdir': '/tmp'})
                    mocked.assert_called_with(
                        'something.zip',
                        '/tmp/something.1.0.zip')
Exemplo n.º 2
0
 def test_makefile_call(self):
     with mock.patch('subprocess.call') as mocked:
         create_zipfile({})
         self.assertTrue(mocked.called)
Exemplo n.º 3
0
 def test_stops_if_prerequisites_wrong(self):
     # Should return false for us.
     self.assertFalse(create_zipfile({}))