Exemplo n.º 1
0
def ENSURE_WRITE_CMD(state, arg):
    install.ensure_write(state["prefix"], arg)
Exemplo n.º 2
0
 def test_returns_none_on_true(self):
     with self.generate_mock_check():
         actual = install.ensure_write(self.prefix, self.meta)
         self.assertTrue(actual is None)
Exemplo n.º 3
0
 def test_raises_correct_exception_if_unable_to_write(self):
     with self.generate_mock_check(return_value=False):
         with self.assertRaises(exceptions.UnableToWriteToPackage):
             install.ensure_write(self.prefix, self.meta)
Exemplo n.º 4
0
def test_ensure_write_takes_two_arguments(args):
    with pytest.raises(TypeError):
        install.ensure_write(*args)
Exemplo n.º 5
0
 def test_dispatches_to_can_open_all_files(self):
     with self.generate_mock_check() as can:
         install.ensure_write(self.prefix, self.dist)
     can.assert_called_with(self.prefix, self.meta['files'])
Exemplo n.º 6
0
 def test_raises_correct_exception_if_unable_to_write(self):
     with self.generate_mock_check(return_value=False):
         with self.assertRaises(exceptions.UnableToWriteToPackage):
             install.ensure_write(self.prefix, self.meta)
Exemplo n.º 7
0
 def test_returns_none_on_true(self):
     with self.generate_mock_check():
         actual = install.ensure_write(self.prefix, self.meta)
         self.assertTrue(actual is None)
Exemplo n.º 8
0
 def test_dispatches_to_can_open_all_files(self):
     with self.generate_mock_check() as can:
         install.ensure_write(self.prefix, self.dist)
     can.assert_called_with(self.prefix, self.meta['files'])
Exemplo n.º 9
0
def test_ensure_write_takes_two_arguments(args):
    with pytest.raises(TypeError):
        install.ensure_write(*args)
Exemplo n.º 10
0
def ENSURE_WRITE_CMD(state, arg):
    install.ensure_write(state["prefix"], arg)