Example #1
0
 def test_type(self):
     self.option.type = fomod.OptionType.REQUIRED
     assert self.option.type is fomod.OptionType.REQUIRED
     assert self.option._type is fomod.OptionType.REQUIRED
     test = fomod.Type()
     self.option.type = test
     assert self.option.type is test
     assert self.option._type is test
Example #2
0
def test_installeroption():
    test_option = fomod.Option()
    test_option.name = "name"
    test_option.description = "description"
    test_option.image = "image"
    test_option.type = fomod.OptionType.REQUIRED
    inst_option = installer.InstallerOption(None, test_option)
    assert inst_option._object is test_option
    assert inst_option._installer is None
    assert inst_option.name == "name"
    assert inst_option.description == "description"
    assert inst_option.image == "image"
    assert inst_option.type is fomod.OptionType.REQUIRED
    test_option.type = fomod.Type()
    test_option.type.default = fomod.OptionType.NOTUSABLE
    installer_mock = Mock(spec=installer.Installer)
    inst_option = installer.InstallerOption(installer_mock, test_option)
    assert inst_option._installer is installer_mock
    assert inst_option.type is fomod.OptionType.NOTUSABLE
    test_option.type[fomod.Conditions()] = fomod.OptionType.COULDBEUSABLE
    inst_option = installer.InstallerOption(installer_mock, test_option)
    assert inst_option.type is fomod.OptionType.COULDBEUSABLE
Example #3
0
 def setup_method(self):
     self.type = fomod.Type()