Exemple #1
0
 def tst_rate_attribute_is_None(self):
     """testing if the rate attribute can be set to None
     """
     from anima.edit import Rate
     r = Rate(timebase='24', ntsc=False)
     c = Clip(rate=r)
     self.assertIsNotNone(c.rate)
     c.rate = None
     self.assertIsNone(c.rate)
Exemple #2
0
 def tst_rate_attribute_is_None(self):
     """testing if the rate attribute can be set to None
     """
     from anima.edit import Rate
     r = Rate(timebase='24', ntsc=False)
     c = Clip(rate=r)
     self.assertIsNotNone(c.rate)
     c.rate = None
     self.assertIsNone(c.rate)
Exemple #3
0
    def test_rate_attribute_is_valid_to_xml_is_working_properly(self):
        """testing if the rate attribute will be included int the xml output if
        it is not None
        """
        f = File()
        f.duration = 34
        f.name = 'shot2'
        f.pathurl = 'file://localhost/home/eoyilmaz/maya/projects/default/data/shot2.mov'

        c = Clip()
        c.id = 'shot2'
        c.start = 1
        c.end = 35
        c.name = 'shot2'
        c.enabled = True
        c.duration = 34
        c.in_ = 0
        c.out = 34
        c.file = f
        c.rate = Rate(timebase='25')

        expected_xml = \
            """<clipitem id="shot2">
  <end>35</end>
  <name>shot2</name>
  <enabled>True</enabled>
  <start>1</start>
  <in>0</in>
  <duration>34</duration>
  <rate>
    <timebase>25</timebase>
    <ntsc>FALSE</ntsc>
  </rate>
  <out>34</out>
  <file id="shot2.mov">
    <duration>34</duration>
    <name>shot2</name>
    <pathurl>file://localhost/home/eoyilmaz/maya/projects/default/data/shot2.mov</pathurl>
  </file>
</clipitem>"""

        self.maxDiff = None
        self.assertEqual(
            expected_xml,
            c.to_xml()
        )
Exemple #4
0
    def test_rate_attribute_is_valid_to_xml_is_working_properly(self):
        """testing if the rate attribute will be included int the xml output if
        it is not None
        """
        f = File()
        f.duration = 34
        f.name = 'shot2'
        f.pathurl = 'file://localhost/home/eoyilmaz/maya/projects/default/data/shot2.mov'

        c = Clip()
        c.id = 'shot2'
        c.start = 1
        c.end = 35
        c.name = 'shot2'
        c.enabled = True
        c.duration = 34
        c.in_ = 0
        c.out = 34
        c.file = f
        c.rate = Rate(timebase='25')

        expected_xml = \
            """<clipitem id="shot2">
  <end>35</end>
  <name>shot2</name>
  <enabled>True</enabled>
  <start>1</start>
  <in>0</in>
  <duration>34</duration>
  <rate>
    <timebase>25</timebase>
    <ntsc>FALSE</ntsc>
  </rate>
  <out>34</out>
  <file id="shot2.mov">
    <duration>34</duration>
    <name>shot2</name>
    <pathurl>file://localhost/home/eoyilmaz/maya/projects/default/data/shot2.mov</pathurl>
  </file>
</clipitem>"""

        self.maxDiff = None
        self.assertEqual(expected_xml, c.to_xml())