<s> import unittest <EOL> from robot . running import TestSuite <EOL> from robot . utils import StringIO <EOL> from robot . utils . asserts import assert_equal , assert_raises_with_msg <EOL> def run ( suite , ** config ) : <EOL> result = suite . run ( output = None , log = None , report = None , <EOL> stdout = StringIO ( ) , stderr = StringIO ( ) , ** config ) <EOL> return result . suite <EOL> def assert_suite ( suite , name , status , message = '<STR_LIT>' , tests = <NUM_LIT:1> ) : <EOL> assert_equal ( suite . name , name ) <EOL> assert_equal ( suite . status , status ) <EOL> assert_equal ( suite . message , message ) <EOL> assert_equal ( len ( suite . tests ) , tests ) <EOL> def assert_test ( test , name , status , tags = ( ) , msg = '<STR_LIT>' ) : <EOL> assert_equal ( test . name , name ) <EOL> assert_equal ( test . status , status ) <EOL> assert_equal ( test . message , msg ) <EOL> assert_equal ( tuple ( test . tags ) , tags ) <EOL> class TestImports ( unittest . TestCase ) : <EOL> def test_imports ( self ) : <EOL> suite = TestSuite ( name = '<STR_LIT>' ) <EOL> suite . resource . imports . create ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> suite . tests . create ( name = '<STR_LIT>' ) . keywords . create ( '<STR_LIT>' , <EOL> args = [ '<STR_LIT:.>' ] ) <EOL> result = run ( suite ) <EOL> assert_suite ( result , '<STR_LIT>' , '<STR_LIT>' ) <EOL> assert_test ( result . tests [ <NUM_LIT:0> ] , '<STR_LIT>' , '<STR_LIT>' ) <EOL> def test_library_imports ( self ) : <EOL> suite = TestSuite ( name = '<STR_LIT>' ) <EOL> suite . resource . imports . library ( '<STR_LIT>' ) <EOL> suite . tests . create ( name = '<STR_LIT>' ) . keywords . create ( '<STR_LIT>' , <EOL> args = [ '<STR_LIT:.>' ] ) <EOL> result = run ( suite ) <EOL> assert_suite ( result , '<STR_LIT>' , '<STR_LIT>' ) <EOL> assert_test ( result . tests [ <NUM_LIT:0> ] , '<STR_LIT>' , '<STR_LIT>' ) <EOL> def test_resource_imports ( self ) : <EOL> suite = TestSuite ( name = '<STR_LIT>' ) <EOL> suite . resource . imports . resource ( '<STR_LIT>' ) <EOL> suite . tests . create ( name = '<STR_LIT>' ) . keywords . create ( '<STR_LIT>' ) <EOL> assert_equal ( suite . tests [ <NUM_LIT:0> ] . keywords [ <NUM_LIT:0> ] . name , '<STR_LIT>' ) <EOL> result = run ( suite ) <EOL> assert_suite ( result , '<STR_LIT>' , '<STR_LIT>' ) <EOL> assert_test ( result . tests [ <NUM_LIT:0> ] , '<STR_LIT>' , '<STR_LIT>' ) <EOL> def test_variable_imports ( self ) : <EOL> suite = TestSuite ( name = '<STR_LIT>' ) <EOL> suite . resource . imports . variables ( '<STR_LIT>' ) <EOL> suite . tests . create ( name = '<STR_LIT>' ) . keywords . create ( <EOL> '<STR_LIT>' , <EOL> args = [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> ) <EOL> result = run ( suite ) <EOL> assert_suite ( result , '<STR_LIT>' , '<STR_LIT>' ) <EOL> assert_test ( result . tests [ <NUM_LIT:0> ] , '<STR_LIT>' , '<STR_LIT>' ) <EOL> def test_invalid_import_type ( self ) : <EOL> assert_raises_with_msg ( ValueError , <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" , <EOL> TestSuite ( ) . resource . imports . create , <EOL> '<STR_LIT>' , '<STR_LIT:Name>' ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
