示例#1
0
文件: test_vcs.py 项目: jackqu7/Facio
    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.')
示例#2
0
文件: test_vcs.py 项目: jackqu7/Facio
    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))
示例#3
0
文件: test_vcs.py 项目: jackqu7/Facio
    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())
示例#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))
示例#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.')
示例#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())
示例#7
0
    def test_repository_path(self):
        instance = BaseVCS('git+/foo/+bar')

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