Beispiel #1
0
 def test_repr(self) -> None:
     locale_configuration_a = LocaleConfiguration('nl-NL')
     sut = LocalesConfiguration([
         locale_configuration_a,
     ])
     with assert_in_scope(sut):
         self.assertIsInstance(repr(sut), str)
Beispiel #2
0
 def test_getitem(self) -> None:
     locale_configuration_a = LocaleConfiguration('nl-NL')
     sut = LocalesConfiguration([
         locale_configuration_a,
     ])
     with assert_in_scope(sut):
         self.assertEquals(locale_configuration_a, sut['nl-NL'])
Beispiel #3
0
 def test_contains(self) -> None:
     locale_configuration_a = LocaleConfiguration('nl-NL')
     sut = LocalesConfiguration([
         locale_configuration_a,
     ])
     with assert_in_scope(sut):
         self.assertIn('nl-NL', sut)
         self.assertNotIn('en-US', sut)
Beispiel #4
0
 def test_getitem(self) -> None:
     extension_configuration_a = ExtensionConfiguration(
         ConfigurableExtension)
     sut = ExtensionsConfiguration([
         extension_configuration_a,
     ])
     with assert_in_scope(sut):
         self.assertEquals(extension_configuration_a,
                           sut[ConfigurableExtension])
Beispiel #5
0
 def test_len(self) -> None:
     locale_configuration_a = LocaleConfiguration('nl-NL')
     locale_configuration_b = LocaleConfiguration('en-US')
     sut = LocalesConfiguration([
         locale_configuration_a,
         locale_configuration_b,
     ])
     with assert_in_scope(sut):
         self.assertEquals(2, len(sut))
Beispiel #6
0
 def test_len(self) -> None:
     extension_configuration_a = ExtensionConfiguration(
         ConfigurableExtension)
     extension_configuration_b = ExtensionConfiguration(
         NonConfigurableExtension)
     sut = ExtensionsConfiguration([
         extension_configuration_a,
         extension_configuration_b,
     ])
     with assert_in_scope(sut):
         self.assertEquals(2, len(sut))
Beispiel #7
0
 def test_iter(self) -> None:
     extension_configuration_a = ExtensionConfiguration(
         ConfigurableExtension)
     extension_configuration_b = ExtensionConfiguration(
         NonConfigurableExtension)
     sut = ExtensionsConfiguration([
         extension_configuration_a,
         extension_configuration_b,
     ])
     with assert_in_scope(sut):
         self.assertCountEqual(
             [extension_configuration_a, extension_configuration_b],
             iter(sut))