Beispiel #1
0
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"
Beispiel #2
0
def test_module_name(test_gist_id):
    hellos = import_gist("hellos", test_gist_id)
    assert hellos.__name__ == "hellos"
Beispiel #3
0
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"
Beispiel #4
0
def test_import(test_gist_id):
    import_gist("hellos", test_gist_id)
Beispiel #5
0
def test_invalid_file_import(bad_gist):
    with pytest.raises(Exception):
        import_gist("foo", bad_gist)
Beispiel #6
0
def test_invalid_module_name(good_small_gist):
    with pytest.raises(ValueError):
        import_gist("foo bar", good_small_gist)
Beispiel #7
0
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"
Beispiel #8
0
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"