Example #1
0
    def test_id_after_a_second_call_to_to_xml_will_change_id_id(self):
        """testing if the id attribute will be changed to an element with just
        id attribute
        """
        f = File(
            pathurl='file://localhost/S:/KKS/Sequences/SEQ001/001A_TNGE/Shots'
                    '/Seq001_001A_TNGE_0010/Comp/Outputs/Main/v001/exr/'
                    'KKS_Seq001_001A_TNGE_0010_Comp_Main_v001.%5B000-379%5D'
                    '.exr'
        )
        # the first call
        call1 = f.to_xml()
        # the second call
        call2 = f.to_xml()
        # the third call
        call3 = f.to_xml()

        # now the first call should be different than the others
        self.assertNotEqual(call1, call2)
        # but the second and third call should be the same
        self.assertEqual(call2, call3)
        # and it should be a file element with just the id attribute
        self.assertEqual(
            call2,
            '<file id="%s"/>' % f.id
        )
Example #2
0
    def test_id_after_a_second_call_to_to_xml_will_change_id_id(self):
        """testing if the id attribute will be changed to an element with just
        id attribute
        """
        f = File(
            pathurl='file://localhost/S:/KKS/Sequences/SEQ001/001A_TNGE/Shots'
            '/Seq001_001A_TNGE_0010/Comp/Outputs/Main/v001/exr/'
            'KKS_Seq001_001A_TNGE_0010_Comp_Main_v001.%5B000-379%5D'
            '.exr')
        # the first call
        call1 = f.to_xml()
        # the second call
        call2 = f.to_xml()
        # the third call
        call3 = f.to_xml()

        # now the first call should be different than the others
        self.assertNotEqual(call1, call2)
        # but the second and third call should be the same
        self.assertEqual(call2, call3)
        # and it should be a file element with just the id attribute
        self.assertEqual(call2, '<file id="%s"/>' % f.id)
Example #3
0
    def test_to_xml_method_is_working_properly_with_tab_with_argument(self):
        """testing if the to xml method is working properly
        """
        f = File()
        f.duration = 34.0
        f.name = 'shot2'
        f.pathurl = 'file:///home/eoyilmaz/maya/projects/default/data/shot2.mov'

        expected_xml = \
            """  <file>
    <duration>34.0</duration>
    <name>shot2</name>
    <pathurl>file:///home/eoyilmaz/maya/projects/default/data/shot2.mov</pathurl>
  </file>"""

        self.assertEqual(expected_xml, f.to_xml(indentation=2, pre_indent=2))
Example #4
0
    def test_to_xml_method_is_working_properly(self):
        """testing if the to xml method is working properly
        """
        f = File()
        f.duration = 34
        f.name = 'shot2'
        f.pathurl = 'file://localhost/home/eoyilmaz/maya/projects/default/data/' \
                    'shot2.mov'

        expected_xml = \
            """<file id="shot2.mov">
  <duration>34</duration>
  <name>shot2</name>
  <pathurl>file://localhost/home/eoyilmaz/maya/projects/default/data/shot2.mov</pathurl>
</file>"""

        self.assertEqual(expected_xml, f.to_xml())
Example #5
0
    def test_to_xml_method_is_working_properly_with_tab_with_argument(self):
        """testing if the to xml method is working properly
        """
        f = File()
        f.duration = 34.0
        f.name = 'shot2'
        f.pathurl = 'file:///home/eoyilmaz/maya/projects/default/data/shot2.mov'

        expected_xml = \
            """  <file>
    <duration>34.0</duration>
    <name>shot2</name>
    <pathurl>file:///home/eoyilmaz/maya/projects/default/data/shot2.mov</pathurl>
  </file>"""

        self.assertEqual(
            expected_xml,
            f.to_xml(indentation=2, pre_indent=2)
        )
Example #6
0
    def test_to_xml_method_is_working_properly(self):
        """testing if the to xml method is working properly
        """
        f = File()
        f.duration = 34
        f.name = 'shot2'
        f.pathurl = 'file://localhost/home/eoyilmaz/maya/projects/default/data/' \
                    'shot2.mov'

        expected_xml = \
            """<file id="shot2.mov">
  <duration>34</duration>
  <name>shot2</name>
  <pathurl>file://localhost/home/eoyilmaz/maya/projects/default/data/shot2.mov</pathurl>
</file>"""

        self.assertEqual(
            expected_xml,
            f.to_xml()
        )