# Path: lbuild/config.py
# class Option:
#     """
#     Option in the configuration file.
#     """
# 
#     def __init__(self, name, value):
#         """
#         Construct a new option.
# 
#         Args:
#             name: Option name. Can be not fully qualified.
#             value: Value of the option.
#         """
#         self.name = name
#         self.value = value
# 
#     def __eq__(self, other):
#         return (self.name == other.name and self.value == other.value)
# 
#     def __lt__(self, other):
#         return self.name < other.name
# 
#     def __repr__(self):
#         return "<Option: {}={}>".format(self.name, self.value)


import os
import sys
import unittest
import lbuild
from lbuild.config import Option
        self.assertIn(os.path.join(config.configpath, "repo1.lb"), config.repositories)
        self.assertIn(os.path.join(config.configpath, "repo3.lb"), config.repositories)

        self.assertEqual(6, len(config.options))
        self.assertEqual(Option(":other:xyz", "No"), config.options[0])
        self.assertEqual(Option("::abc", "Hello World!"), config.options[1])

        self.assertEqual(Option("repo1:other:foo", "456"), config.options[2])
        self.assertEqual(Option("repo1::bar", "768"), config.options[3])

        self.assertEqual(Option(":target", "hosted"), config.options[4])
        self.assertEqual(Option("repo1:foo", "42"), config.options[5])

        self.assertEqual(3, len(config.selected_modules))
        self.assertIn("repo1:other", config.selected_modules)
        self.assertIn(":module1", config.selected_modules)
        self.assertIn("::submodule3:subsubmodule2", config.selected_modules)

    def test_should_recursive_inherit_from_multiple_bases_configuration(self):
        config = self._parse_config("configfile_inheritance/depth_2_multiple.xml")

        self.assertEqual(3, len(config.repositories))
        self.assertIn(os.path.join(config.configpath, "repo1.lb"), config.repositories)
        self.assertIn(os.path.join(config.configpath, "repo3.lb"), config.repositories)
        self.assertIn(os.path.join(config.configpath, "repo2.lb"), config.repositories)

        self.assertEqual(7, len(config.options))
        self.assertEqual(Option("repo1:other:foo", "456"), config.options[0])
        self.assertEqual(Option("repo1::bar", "768"), config.options[1])


# Path: lbuild/config.py
# class Option:
#     """
#     Option in the configuration file.
#     """
# 
#     def __init__(self, name, value):
#         """
#         Construct a new option.
# 
#         Args:
#             name: Option name. Can be not fully qualified.
#             value: Value of the option.
#         """
#         self.name = name
#         self.value = value
# 
#     def __eq__(self, other):
#         return (self.name == other.name and self.value == other.value)
# 
#     def __lt__(self, other):
#         return self.name < other.name
# 
#     def __repr__(self):
#         return "<Option: {}={}>".format(self.name, self.value)


# Path: test/config_test.py
import os
import sys
import unittest
import lbuild
from lbuild.config import Option

        self.assertIn(os.path.join(config.configpath, "repo1.lb"), config.repositories)
        self.assertIn(os.path.join(config.configpath, "repo3.lb"), config.repositories)

        self.assertEqual(6, len(config.options))
        self.assertEqual(Option(":other:xyz", "No"), config.options[0])
        self.assertEqual(Option("::abc", "Hello World!"), config.options[1])

        self.assertEqual(Option("repo1:other:foo", "456"), config.options[2])
        self.assertEqual(Option("repo1::bar", "768"), config.options[3])

        self.assertEqual(Option(":target", "hosted"), config.options[4])
        self.assertEqual(Option("repo1:foo", "42"), config.options[5])

        self.assertEqual(3, len(config.selected_modules))
        self.assertIn("repo1:other", config.selected_modules)
        self.assertIn(":module1", config.selected_modules)
        self.assertIn("::submodule3:subsubmodule2", config.selected_modules)

    def test_should_recursive_inherit_from_multiple_bases_configuration(self):
        config = self._parse_config("configfile_inheritance/depth_2_multiple.xml")

        self.assertEqual(3, len(config.repositories))
        self.assertIn(os.path.join(config.configpath, "repo1.lb"), config.repositories)
        self.assertIn(os.path.join(config.configpath, "repo3.lb"), config.repositories)
        self.assertIn(os.path.join(config.configpath, "repo2.lb"), config.repositories)

        self.assertEqual(7, len(config.options))
        self.assertEqual(Option("repo1:other:foo", "456"), config.options[0])
        self.assertEqual(Option("repo1::bar", "768"), config.options[1])


        self.assertEqual(Option(":other:xyz", "Yes"), config.options[2])