def setUp(self): super().setUp() self.source = Script('source', 'destination') os.mkdir('destination') self.source.file = os.path.join('destination', 'file') open(self.source.file, 'w').close()
def setUp(self): super().setUp() self.source = Script("source", "destination") os.mkdir("destination") self.source.file = os.path.join("destination", "file") open(self.source.file, "w").close()
class TestScript(unit.TestCase): def setUp(self): super().setUp() self.source = Script('source', 'destination') os.mkdir('destination') self.source.file = os.path.join('destination', 'file') open(self.source.file, 'w').close() @mock.patch('snapcraft.internal.sources._script.FileBase.download') def test_download_makes_executable(self, mock_download): self.source.file = os.path.join('destination', 'file') self.source.download() self.assertThat(self.source.file, FileExists()) self.assertThat(self.source.file, unit.IsExecutable())
class TestScript(tests.TestCase): def setUp(self): super().setUp() self.source = Script('source', 'destination') os.mkdir('destination') self.source.file = os.path.join('destination', 'file') open(self.source.file, 'w').close() @mock.patch('snapcraft.internal.sources._script.FileBase.download') def test_download_makes_executable(self, mock_download): self.source.file = os.path.join('destination', 'file') self.source.download() self.assertThat(self.source.file, FileExists()) self.assertThat(self.source.file, tests.IsExecutable())
class TestScript(unit.TestCase): def setUp(self): super().setUp() self.source = Script("source", "destination") os.mkdir("destination") self.source.file = os.path.join("destination", "file") open(self.source.file, "w").close() @mock.patch("snapcraft.internal.sources._script.FileBase.download") def test_download_makes_executable(self, mock_download): self.source.file = os.path.join("destination", "file") self.source.download() self.assertThat(self.source.file, FileExists()) self.assertThat(self.source.file, unit.IsExecutable())