Beispiel #1
0
    def test_get_identifier(self):
        """Tests the get_identifier function."""
        attribute_container = interface.AttributeContainer()

        identifier = attribute_container.get_identifier()

        self.assertIsNotNone(identifier)
Beispiel #2
0
    def test_get_attribute_names(self):
        """Tests the get_attribute_names function."""
        attribute_container = interface.AttributeContainer()
        attribute_container.attribute_name = 'attribute_name'
        attribute_container.attribute_value = 'attribute_value'

        expected_attribute_names = ['attribute_name', 'attribute_value']

        attribute_names = sorted(attribute_container.get_attribute_names())

        self.assertEqual(attribute_names, expected_attribute_names)
Beispiel #3
0
    def test_copy_to_dict(self):
        """Tests the copy_to_dict function."""
        attribute_container = interface.AttributeContainer()
        attribute_container.attribute_name = 'attribute_name'
        attribute_container.attribute_value = 'attribute_value'

        expected_dict = {
            'attribute_name': 'attribute_name',
            'attribute_value': 'attribute_value'
        }

        test_dict = attribute_container.copy_to_dict()

        self.assertEqual(test_dict, expected_dict)
Beispiel #4
0
    def test_get_attribute_values_string(self):
        """Tests the get_attribute_values_string function."""
        attribute_container = interface.AttributeContainer()
        attribute_container.attribute_name = 'attribute_name'
        attribute_container.attribute_value = 'attribute_value'

        attribute_values_string1 = attribute_container.get_attribute_values_string(
        )

        attribute_container.attribute_value = 'changes'

        attribute_values_string2 = attribute_container.get_attribute_values_string(
        )

        self.assertNotEqual(attribute_values_string1, attribute_values_string2)
Beispiel #5
0
    def test_set_session_identifier(self):
        """Tests the set_session_identifier function."""
        attribute_container = interface.AttributeContainer()

        attribute_container.set_session_identifier(None)