Пример #1
0
    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()
Пример #2
0
    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()
Пример #3
0
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())
Пример #4
0
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())
Пример #5
0
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())
Пример #6
0
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())
Пример #7
0
    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()
Пример #8
0
    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()