def test_load_license_policy_invalid(self):
        test_file = self.get_test_loc(
            'plugin_license_policy/load_license_policy_invalid.yml')

        result = load_license_policy(test_file)

        assert {} == result
    def test_load_license_policy_empty(self):
        test_file = self.get_test_loc(
            'plugin_license_policy/load_license_policy_empty.yml')

        expected = dict([(u'license_policies', [])])

        result = load_license_policy(test_file)

        assert expected == result
    def test_load_license_policy_duplicate_keys(self):
        test_file = self.get_test_loc('plugin_license_policy/load_license_policy_duplicate_keys.yml')

        expected = OrderedDict([
            ('license_policies', [
                OrderedDict([
                    ('license_key', 'broadcom-commercial'),
                    ('label', 'Restricted License'),
                    ('color_code', '#FFcc33'),
                    ('icon', 'icon-warning-sign'),
                ]),
                OrderedDict([
                    ('license_key', 'bsd-1988'),
                    ('label', 'Approved License'),
                    ('color_code', '#008000'),
                    ('icon', 'icon-ok-circle'),
                ]),
                OrderedDict([
                    ('license_key', 'esri-devkit'),
                    ('label', 'Restricted License'),
                    ('color_code', '#FFcc33'),
                    ('icon', 'icon-warning-sign'),
                ]),
                OrderedDict([
                    ('license_key', 'oracle-java-ee-sdk-2010'),
                    ('label', 'Restricted License'),
                    ('color_code', '#FFcc33'),
                    ('icon', 'icon-warning-sign'),
                ]),
                OrderedDict([
                    ('license_key', 'rh-eula'),
                    ('label', 'Restricted License'),
                    ('color_code', '#FFcc33'),
                    ('icon', 'icon-warning-sign'),
                ]),
                OrderedDict([
                    ('license_key', 'broadcom-commercial'),
                    ('label', 'Approved License'),
                    ('color_code', '#008000'),
                    ('icon', 'icon-ok-circle'),
                ]),
            ])
        ])

        result = load_license_policy(test_file)

        assert expected == result