Ejemplo n.º 1
0
    def test_clone_raises_exception(self, mock_exit):
        instance = BaseVCS('git+/foo/bar')

        with self.assertRaises(FacioException):
            instance.clone()
        self.mocked_facio_exceptions_puts.assert_any_call(
            'Error: The clone method on BaseVCS needs to be overridden.')
Ejemplo n.º 2
0
    def test_rm_temp_dir(self):
        instance = BaseVCS('git+/foo/bar')
        d = instance.get_temp_directory()

        instance.remove_tmp_dir(d, '/foo/bar')

        self.assertFalse(os.path.isdir(d))
Ejemplo n.º 3
0
    def test_get_temp_directory(self, mock_tempfile):
        instance = BaseVCS('git+/foo/bar')
        path = instance.get_temp_directory()
        mock_tempfile.return_value = '/tmp/bar'

        mock_tempfile.assert_called_with(suffix='facio')
        self.assertEqual(path, instance.get_temp_directory())
Ejemplo n.º 4
0
    def test_rm_temp_dir(self):
        instance = BaseVCS('git+/foo/bar')
        d = instance.get_temp_directory()

        instance.remove_tmp_dir(d, '/foo/bar')

        self.assertFalse(os.path.isdir(d))
Ejemplo n.º 5
0
    def test_clone_raises_exception(self, mock_exit):
        instance = BaseVCS('git+/foo/bar')

        with self.assertRaises(FacioException):
            instance.clone()
        self.mocked_facio_exceptions_puts.assert_any_call(
            'Error: The clone method on BaseVCS needs to be overridden.')
Ejemplo n.º 6
0
    def test_get_temp_directory(self, mock_tempfile):
        instance = BaseVCS('git+/foo/bar')
        path = instance.get_temp_directory()
        mock_tempfile.return_value = '/tmp/bar'

        mock_tempfile.assert_called_with(suffix='facio')
        self.assertEqual(path, instance.get_temp_directory())
Ejemplo n.º 7
0
    def test_repository_path(self):
        instance = BaseVCS('git+/foo/+bar')

        self.assertEqual(instance.path, '/foo/+bar')
        self.assertEqual(instance.vcs, 'git')