Esempio n. 1
0
    def test__replace_in_parts(self):
        class Options:
            def __init__(self):
                self.source = '$SNAPCRAFT_PART_INSTALL'

        class Plugin:
            def __init__(self):
                self.options = Options()
                self.installdir = '/tmp'

        class Part:
            def __init__(self):
                self.plugin = Plugin()

        part = Part()
        new_part = _replace_in_part(part)

        self.assertThat(
            new_part.plugin.options.source, Equals(part.plugin.installdir))
Esempio n. 2
0
    def test_replace_in_parts(self):
        class Options:
            def __init__(self):
                self.source = "$SNAPCRAFT_PART_INSTALL"

        class Plugin:
            def __init__(self):
                self.options = Options()
                self.sourcedir = "/tmp"
                self.builddir = "/tmp"
                self.installdir = "/tmp"

        class Part:
            def __init__(self):
                self.plugin = Plugin()

        part = Part()
        new_part = _replace_in_part(part)

        self.assertThat(new_part.plugin.options.source, Equals(part.plugin.installdir))
Esempio n. 3
0
    def test_replace_in_parts(self):
        class Options:
            def __init__(self):
                self.source = "$SNAPCRAFT_PART_INSTALL"

        class Plugin:
            def __init__(self):
                self.options = Options()

        class Part:
            def __init__(self):
                self.plugin = Plugin()
                self.part_source_dir = "/tmp"
                self.part_build_dir = "/tmp"
                self.part_install_dir = "/tmp"

        part = Part()
        new_part = _replace_in_part(part)

        self.assertThat(new_part.plugin.options.source,
                        Equals(part.part_install_dir))