Ejemplo n.º 1
0
class TestListOfCreatedScripts:
    def setUp(self):
        self.bindir = Scripts(make_file_executable=Mock(), write_file=Mock())

    def test_is_empty_on_start_up(self):
        assert_equals(self.bindir.created_scripts, [])

    def test_collect_added_script(self):
        self.bindir.add_script('foo-command', 'foo-module', 'main')
        assert_equals(self.bindir.created_scripts, ['foo-command'])
Ejemplo n.º 2
0
    def setUp(self):
        self.make_file_executable = Mock()
        self.write_file = Mock()
        def capture(name, contents):
            self.name = name
            self.contents = contents
        self.write_file.side_effect = capture

        bindir = Scripts(
                make_file_executable = self.make_file_executable,
                write_file           = self.write_file)
        bindir.add_script('trash-put', 'trashcli.cmds', 'put')
Ejemplo n.º 3
0
class TestListOfCreatedScripts(unittest.TestCase):
    def setUp(self):
        self.bindir = Scripts(make_file_executable=Mock(), write_file=Mock())

    def test_is_empty_on_start_up(self):
        assert self.bindir.created_scripts == []

    def test_collect_added_script(self):
        self.bindir.add_script('foo-command', 'foo-module', 'main')
        assert self.bindir.created_scripts == [
            script_path_without_base_dir_for('foo-command')
        ]
Ejemplo n.º 4
0
    def setUp(self):
        self.make_file_executable = Mock()
        self.write_file = Mock()
        def capture(name, contents):
            self.name = name
            self.contents = contents
        self.write_file.side_effect = capture

        bindir = Scripts(
                make_file_executable = self.make_file_executable,
                write_file           = self.write_file)
        bindir.add_script('trash-put', 'trashcli.cmds', 'put')
Ejemplo n.º 5
0
class TestListOfCreatedScripts:
    def setUp(self):
        self.bindir = Scripts(
                make_file_executable = Mock(),
                write_file           = Mock())

    def test_is_empty_on_start_up(self):
        assert_equals(self.bindir.created_scripts, [])

    def test_collect_added_script(self):
        self.bindir.add_script('foo-command', 'foo-module', 'main')
        assert_equals(self.bindir.created_scripts, ['foo-command'])
Ejemplo n.º 6
0
 def setUp(self):
     self.bindir = Scripts(make_file_executable=Mock(), write_file=Mock())
Ejemplo n.º 7
0
 def setUp(self):
     self.bindir = Scripts(
             make_file_executable = Mock(),
             write_file           = Mock())