<s> import os <EOL> import unittest <EOL> os . environ [ '<STR_LIT>' ] = "<STR_LIT>" <EOL> from anima . env import mayaEnv <EOL> import pymel . core <EOL> class SequencerExtensionTestCase ( unittest . TestCase ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> """<STR_LIT>""" <EOL> pymel . core . newFile ( force = True ) <EOL> def test_set_shot_handles_method_is_working_properly ( self ) : <EOL> """<STR_LIT>""" <EOL> s = pymel . core . createNode ( '<STR_LIT>' ) <EOL> shot1 = s . create_shot ( '<STR_LIT>' ) <EOL> shot2 = s . create_shot ( '<STR_LIT>' ) <EOL> shot3 = s . create_shot ( '<STR_LIT>' ) <EOL> self . assertEqual ( <EOL> [ shot1 , shot2 , shot3 ] , <EOL> s . all_shots <EOL> ) <EOL> self . assertNotEqual ( shot1 . handle . get ( ) , <NUM_LIT:50> ) <EOL> self . assertNotEqual ( shot2 . handle . get ( ) , <NUM_LIT:50> ) <EOL> self . assertNotEqual ( shot3 . handle . get ( ) , <NUM_LIT:50> ) <EOL> s . set_shot_handles ( <NUM_LIT:50> ) <EOL> self . assertEqual ( shot1 . handle . get ( ) , <NUM_LIT:50> ) <EOL> self . assertEqual ( shot2 . handle . get ( ) , <NUM_LIT:50> ) <EOL> self . assertEqual ( shot3 . handle . get ( ) , <NUM_LIT:50> ) <EOL> def test_create_shot_is_working_properly ( self ) : <EOL> """<STR_LIT>""" <EOL> s = pymel . core . createNode ( '<STR_LIT>' ) <EOL> shot = s . create_shot ( name = '<STR_LIT>' , handle = <NUM_LIT> ) <EOL> self . assertIsInstance ( shot , pymel . core . nt . Shot ) <EOL> self . assertEqual ( <EOL> '<STR_LIT>' , <EOL> shot . name ( ) <EOL> ) <EOL> self . assertEqual ( <EOL> '<STR_LIT>' , <EOL> shot . shotName . get ( ) <EOL> ) <EOL> self . assertEqual ( <EOL> <NUM_LIT> , <EOL> shot . handle . get ( ) <EOL> ) <EOL> self . assertEqual ( <EOL> s , <EOL> shot . message . outputs ( ) [ <NUM_LIT:0> ] <EOL> ) <EOL> def test_all_shots_property_is_working_properly ( self ) : <EOL> """<STR_LIT>""" <EOL> s = pymel . core . createNode ( '<STR_LIT>' ) <EOL> s1 = s . create_shot ( '<STR_LIT>' ) <EOL> s2 = s . create_shot ( '<STR_LIT>' ) <EOL> s3 = s . create_shot ( '<STR_LIT>' ) <EOL> self . assertItemsEqual ( <EOL> [ s1 , s2 , s3 ] , <EOL> s . all_shots <EOL> ) <EOL> def test_add_shot_with_an_unconnected_shot ( self ) : <EOL> """<STR_LIT>""" <EOL> s = pymel . core . createNode ( '<STR_LIT>' ) <EOL> s1 = pymel . core . createNode ( '<STR_LIT>' ) <EOL> s . add_shot ( s1 ) <EOL> self . assertEqual ( <EOL> [ s1 ] , <EOL> s . all_shots , <EOL> ) <EOL> def test_add_shot_will_add_handle_attributes_if_doesnt_exists ( self ) : <EOL> """<STR_LIT>""" <EOL> s = pymel . core . createNode ( '<STR_LIT>' ) <EOL> s1 = pymel . core . createNode ( '<STR_LIT>' ) <EOL> self . assertFalse ( <EOL> s1 . hasAttr ( '<STR_LIT>' ) <EOL> ) <EOL> s . add_shot ( s1 ) <EOL> self . assertTrue ( <EOL> s1 . hasAttr ( '<STR_LIT>' ) <EOL> ) <EOL> self . assertTrue ( <EOL> <NUM_LIT:10> , <EOL> s1 . handle . get ( ) <EOL> ) <EOL> def test_add_shot_with_a_connected_shot ( self ) : <EOL> """<STR_LIT>""" <EOL> s1 = pymel . core . createNode ( '<STR_LIT>' ) <EOL> s2 = pymel . core . createNode ( '<STR_LIT>' ) <EOL> shot1 = s1 . create_shot ( '<STR_LIT>' ) <EOL> shot2 = s1 . create_shot ( '<STR_LIT>' ) <EOL> shot3 = s2 . create_shot ( '<STR_LIT>' ) <EOL> shot4 = s2 . create_shot ( '<STR_LIT>' ) <EOL> self . assertEqual ( <EOL> [ shot1 , shot2 ] , <EOL> s1 . all_shots <EOL> ) <EOL> self . assertEqual ( <EOL> [ shot3 , shot4 ] , <EOL> s2 . all_shots <EOL> ) <EOL> s1 . add_shot ( shot3 ) <EOL> self . assertEqual ( <EOL> [ shot1 , shot2 , shot3 ] , <EOL> s1 . all_shots <EOL> ) <EOL> self . assertEqual ( <EOL> [ shot4 ] , <EOL> s2 . all_shots <EOL> ) <EOL> s1 . add_shot ( shot4 ) <EOL> self . assertEqual ( <EOL> [ shot1 , shot2 , shot3 , shot4 ] , <EOL> s1 . all_shots <EOL> ) <EOL> self . assertEqual ( <EOL> [ ] , <EOL> s2 . all_shots <EOL> ) <EOL> def test_set_sequence_name_is_working_properly ( self ) : <EOL> """<STR_LIT>""" <EOL> s1 = pymel . core . createNode ( '<STR_LIT>' ) <EOL> self . assertFalse ( s1 . hasAttr ( '<STR_LIT>' ) ) <EOL> s1 . set_sequence_name ( '<STR_LIT>' ) <EOL> self . assertTrue ( s1 . hasAttr ( '<STR_LIT>' ) ) <EOL> self . assertEqual ( <EOL> s1 . sequence_name . get ( ) , <EOL> '<STR_LIT>' <EOL> ) <EOL> def test_get_sequence_name_is_working_properly ( self ) : <EOL> """<STR_LIT>""" <EOL> s1 = pymel . core . createNode ( '<STR_LIT>' ) <EOL> self . assertFalse ( s1 . hasAttr ( '<STR_LIT>' ) ) <EOL> s1 . set_sequence_name ( '<STR_LIT>' ) <EOL> self . assertTrue ( s1 . hasAttr ( '<STR_LIT>' ) ) <EOL> self . assertEqual ( <EOL> s1 . get_sequence_name ( ) , <EOL> '<STR_LIT>' <EOL> ) <EOL> def test_get_sequence_name_will_create_sequence_name_attribute_if_missing ( self ) : <EOL> """<STR_LIT>""" <EOL> s1 = pymel . core . createNode ( '<STR_LIT>' ) <EOL> self . assertFalse ( s1 . hasAttr ( '<STR_LIT>' ) ) <EOL> result = s1 . get_sequence_name ( ) <EOL> self . assertTrue ( s1 . hasAttr ( '<STR_LIT>' ) ) <EOL> self . assertEqual ( s1 . get_sequence_name ( ) , result ) <EOL> def test_mute_shots_is_working_properly ( self ) : <EOL> """<STR_LIT>""" <EOL> sm = pymel . core . PyNode ( '<STR_LIT>' ) <EOL> seq1 = sm . create_sequence ( '<STR_LIT>' ) <EOL> shot1 = seq1 . create_shot ( '<STR_LIT>' ) <EOL> shot2 = seq1 . create_shot ( '<STR_LIT>' ) <EOL> shot3 = seq1 . create_shot ( '<STR_LIT>' ) <EOL> self . assertFalse ( pymel . core . shot ( shot1 , q = <NUM_LIT:1> , mute = <NUM_LIT:1> ) ) <EOL> self . assertFalse ( pymel . core . shot ( shot2 , q = <NUM_LIT:1> , mute = <NUM_LIT:1> ) ) <EOL> self . assertFalse ( pymel . core . shot ( shot3 , q = <NUM_LIT:1> , mute = <NUM_LIT:1> ) ) <EOL> seq1 . mute_shots ( ) <EOL> self . assertTrue ( pymel . core . shot ( shot1 , q = <NUM_LIT:1> , mute = <NUM_LIT:1> ) ) <EOL> self . assertTrue ( pymel . core . shot ( shot2 , q = <NUM_LIT:1> , mute = <NUM_LIT:1> ) ) <EOL> self . assertTrue ( pymel . core . shot ( shot3 , q = <NUM_LIT:1> , mute = <NUM_LIT:1> ) ) <EOL> def test_unmute_shots_is_working_properly ( self ) : <EOL> """<STR_LIT>""" <EOL> sm = pymel . core . PyNode ( '<STR_LIT>' ) <EOL> seq1 = sm . create_sequence ( '<STR_LIT>' ) <EOL> shot1 = seq1 . create_shot ( '<STR_LIT>' ) <EOL> shot2 = seq1 . create_shot ( '<STR_LIT>' ) <EOL> shot3 = seq1 . create_shot ( '<STR_LIT>' ) <EOL> self . assertFalse ( pymel . core . shot ( shot1 , q = <NUM_LIT:1> , mute = <NUM_LIT:1> ) ) <EOL> self . assertFalse ( pymel . core . shot ( shot2 , q = <NUM_LIT:1> , mute = <NUM_LIT:1> ) ) <EOL> self . assertFalse ( pymel . core . shot ( shot3 , q = <NUM_LIT:1> , mute = <NUM_LIT:1> ) ) <EOL> seq1 . mute_shots ( ) <EOL> self . assertTrue ( pymel . core . shot ( shot1 , q = <NUM_LIT:1> , mute = <NUM_LIT:1> ) ) <EOL> self . assertTrue ( pymel . core . shot ( shot2 , q = <NUM_LIT:1> , mute = <NUM_LIT:1> ) ) <EOL> self . assertTrue ( pymel . core . shot ( shot3 , q = <NUM_LIT:1> , mute = <NUM_LIT:1> ) ) <EOL> seq1 . unmute_shots ( ) <EOL> self . assertFalse ( pymel . core . shot ( shot1 , q = <NUM_LIT:1> , mute = <NUM_LIT:1> ) ) <EOL> self . assertFalse ( pymel . core . shot ( shot2 , q = <NUM_LIT:1> , mute = <NUM_LIT:1> ) ) <EOL> self . assertFalse ( pymel . core . shot ( shot3 , q = <NUM_LIT:1> , mute = <NUM_LIT:1> ) ) <EOL> def test_duration_property_is_working_properly ( self ) : <EOL> """<STR_LIT>""" <EOL> sm = pymel . core . PyNode ( '<STR_LIT>' ) <EOL> seq1 = sm . create_sequence ( '<STR_LIT>' ) <EOL> shot1 = seq1 . create_shot ( '<STR_LIT>' ) <EOL> shot1 . startFrame . set ( <NUM_LIT:10> ) <EOL> shot1 . endFrame . set ( <NUM_LIT:20> ) <EOL> shot1 . sequenceStartFrame . set ( <NUM_LIT:10> ) <EOL> shot1 . sequenceEndFrame . set ( <NUM_LIT:20> ) <EOL> shot2 = seq1 . create_shot ( '<STR_LIT>' ) <EOL> shot2 . startFrame . set ( <NUM_LIT:11> ) <EOL> shot2 . endFrame . set ( <NUM_LIT> ) <EOL> shot2 . sequenceStartFrame . set ( <NUM_LIT> ) <EOL> shot2 . sequenceEndFrame . set ( <NUM_LIT> ) <EOL> shot3 = seq1 . create_shot ( '<STR_LIT>' ) <EOL> shot3 . startFrame . set ( <NUM_LIT> ) <EOL> shot3 . endFrame . set ( <NUM_LIT> ) <EOL> shot3 . sequenceStartFrame . set ( <NUM_LIT> ) <EOL> shot3 . sequenceEndFrame . set ( <NUM_LIT> ) <EOL> self . assertEqual ( seq1 . duration , <NUM_LIT> ) <EOL> def test_manager_property_is_working_properly ( self ) : <EOL> """<STR_LIT>""" <EOL> sm = pymel . core . PyNode ( '<STR_LIT>' ) <EOL> seq1 = sm . create_sequence ( '<STR_LIT>' ) <EOL> self . assertEqual ( sm , seq1 . manager ) </s>
