def test_submodules(test_gist_id): hellos = import_gist("hellos", test_gist_id) assert hellos.hello.say_hello() == "hello" assert hellos.hello_again.say_hello_again() == "hello again"
def test_module_name(test_gist_id): hellos = import_gist("hellos", test_gist_id) assert hellos.__name__ == "hellos"
def test_submodule_names(test_gist_id): hellos = import_gist("hellos", test_gist_id) assert hellos.hello.__name__ == "hello" assert hellos.hello_again.__name__ == "hello_again"
def test_import(test_gist_id): import_gist("hellos", test_gist_id)
def test_invalid_file_import(bad_gist): with pytest.raises(Exception): import_gist("foo", bad_gist)
def test_invalid_module_name(good_small_gist): with pytest.raises(ValueError): import_gist("foo bar", good_small_gist)
def test_big_gist_import(good_big_gist): foo = import_gist("foo", good_big_gist) assert foo.__name__ == "foo" assert foo.bar.say_baz() == "baz" assert foo.baz.say_bar() == "bar"
def test_small_gist_import(good_small_gist): foo = import_gist("foo", good_small_gist) assert foo.__name__ == "foo" assert foo.foo.say_bar() == "bar"