Ejemplo n.º 1
0
    def test_with_binaries(self):
        self.config_data["binaries"] = {"binary1": {"exec": "binary1.sh go"}, "binary2": {"exec": "binary2.sh"}}

        y = meta._compose_package_yaml("meta", self.config_data, ["armhf", "amd64"])

        self.assertEqual(len(y["binaries"]), 2)
        for b in y["binaries"]:
            if b["name"] is "binary1":
                self.assertEqual(b["exec"], "binary.wrapped go")
            else:
                self.assertEqual(b["exec"], "binary.wrapped")
Ejemplo n.º 2
0
    def test_plain_no_binaries_or_services_or_arches(self):
        y = meta._compose_package_yaml('meta', self.config_data, None)

        expected = {
            'name': 'my-package',
            'version': '1.0',
            'vendor': 'Sergio Schvezov <*****@*****.**>',
            'icon': 'my-icon.png',
        }

        self.assertEqual(y, expected)
Ejemplo n.º 3
0
    def test_plain_no_binaries_or_services_or_arches(self):
        y = meta._compose_package_yaml("meta", self.config_data, None)

        expected = {
            "name": "my-package",
            "version": "1.0",
            "vendor": "Sergio Schvezov <*****@*****.**>",
            "icon": "my-icon.png",
        }

        self.assertEqual(y, expected)
Ejemplo n.º 4
0
    def test_plain_no_binaries_or_services_or_arches(self):
        y = meta._compose_package_yaml('meta', self.config_data, None)

        expected = {
            'name': 'my-package',
            'version': '1.0',
            'vendor': 'Sergio Schvezov <*****@*****.**>',
            'icon': 'my-icon.png',
        }

        self.assertEqual(y, expected)
Ejemplo n.º 5
0
    def test_plain_no_binaries_or_services_or_arches(self):
        y = meta._compose_package_yaml('meta', self.config_data, ['amd64'])

        expected = {
            'name': 'my-package',
            'version': '1.0',
            'icon': 'my-icon.png',
            'architectures': ['amd64']
        }

        self.assertEqual(y, expected)
Ejemplo n.º 6
0
    def test_plain_no_binaries_or_services_with_optionals(self):
        self.config_data['frameworks'] = ['mir', ]

        y = meta._compose_package_yaml('meta', self.config_data,
                                       ['armhf', 'amd64'])
        expected = {
            'name': 'my-package',
            'version': '1.0',
            'icon': 'my-icon.png',
            'architectures': ['armhf', 'amd64'],
            'frameworks': ['mir', ],
        }

        self.assertEqual(y, expected)
Ejemplo n.º 7
0
    def test_plain_no_binaries_or_services_with_optionals(self):
        self.config_data["frameworks"] = ["mir"]

        y = meta._compose_package_yaml("meta", self.config_data, ["armhf", "amd64"])

        expected = {
            "name": "my-package",
            "version": "1.0",
            "vendor": "Sergio Schvezov <*****@*****.**>",
            "icon": "my-icon.png",
            "architectures": ["armhf", "amd64"],
            "frameworks": ["mir"],
        }

        self.assertEqual(y, expected)
Ejemplo n.º 8
0
    def test_with_services(self):
        self.config_data["services"] = {
            "service1": {"start": "binary1"},
            "service2": {"start": "binary2 --start", "stop": "binary2 --stop"},
        }

        y = meta._compose_package_yaml("meta", self.config_data, ["armhf", "amd64"])

        self.assertEqual(len(y["services"]), 2)
        for b in y["services"]:
            if b["name"] is "service1":
                self.assertEqual(b["start"], "binary.wrapped")
            else:
                self.assertEqual(b["start"], "binary.wrapped --start")
                self.assertEqual(b["stop"], "binary.wrapped --stop")
Ejemplo n.º 9
0
    def test_with_binaries(self):
        self.config_data['binaries'] = {
            'binary1': {'exec': 'binary1.sh go'},
            'binary2': {'exec': 'binary2.sh'},
        }

        y = meta._compose_package_yaml('meta', self.config_data,
                                       ['armhf', 'amd64'])

        self.assertEqual(len(y['binaries']), 2)
        for b in y['binaries']:
            if b['name'] is 'binary1':
                self.assertEqual(b['exec'], 'binary.wrapped go')
            else:
                self.assertEqual(b['exec'], 'binary.wrapped')
Ejemplo n.º 10
0
    def test_with_binaries(self):
        self.config_data['binaries'] = {
            'binary1': {'exec': 'binary1.sh go'},
            'binary2': {'exec': 'binary2.sh'},
        }

        y = meta._compose_package_yaml('meta', self.config_data,
                                       ['armhf', 'amd64'])

        self.assertEqual(len(y['binaries']), 2)
        for b in y['binaries']:
            if b['name'] is 'binary1':
                self.assertEqual(b['exec'], 'binary.wrapped go')
            else:
                self.assertEqual(b['exec'], 'binary.wrapped')
Ejemplo n.º 11
0
    def test_plain_no_binaries_or_services_with_optionals(self):
        self.config_data['frameworks'] = ['mir', ]

        y = meta._compose_package_yaml('meta', self.config_data,
                                       ['armhf', 'amd64'])

        expected = {
            'name': 'my-package',
            'version': '1.0',
            'vendor': 'Sergio Schvezov <*****@*****.**>',
            'icon': 'my-icon.png',
            'architectures': ['armhf', 'amd64'],
            'frameworks': ['mir', ],
        }

        self.assertEqual(y, expected)
Ejemplo n.º 12
0
    def test_license_information(self):
        self.config_data['license-agreement'] = 'explicit'
        self.config_data['license-version'] = '1.0'

        y = meta._compose_package_yaml('meta', self.config_data, ['amd64'])

        expected = {
            'name': 'my-package',
            'version': '1.0',
            'icon': 'my-icon.png',
            'architectures': ['amd64'],
            'license-version': '1.0',
            'explicit-license-agreement': 'yes',
        }

        self.assertEqual(y, expected)
Ejemplo n.º 13
0
    def test_with_services(self):
        self.config_data['services'] = {
            'service1': {'start': 'binary1'},
            'service2': {
                'start': 'binary2 --start',
                'stop': 'binary2 --stop',
            },
        }

        y = meta._compose_package_yaml('meta', self.config_data,
                                       ['armhf', 'amd64'])

        self.assertEqual(len(y['services']), 2)
        for b in y['services']:
            if b['name'] is 'service1':
                self.assertEqual(b['start'], 'binary.wrapped')
            else:
                self.assertEqual(b['start'], 'binary.wrapped --start')
                self.assertEqual(b['stop'], 'binary.wrapped --stop')
Ejemplo n.º 14
0
    def test_with_services(self):
        self.config_data['services'] = {
            'service1': {'start': 'binary1'},
            'service2': {
                'start': 'binary2 --start',
                'stop': 'binary2 --stop',
            },
        }

        y = meta._compose_package_yaml('meta', self.config_data,
                                       ['armhf', 'amd64'])

        self.assertEqual(len(y['services']), 2)
        for b in y['services']:
            if b['name'] is 'service1':
                self.assertEqual(b['start'], 'binary.wrapped')
            else:
                self.assertEqual(b['start'], 'binary.wrapped --start')
                self.assertEqual(b['stop'], 'binary.wrapped --stop')