def f(x):
    try:
        from foo import Bar #pass
    except ImportError:
        class Bar(object):
            pass
    return Bar()
Exemplo n.º 2
0
from foo import Boo
from foo import Bar

boo = Boo()
bar = Bar()

boo.printBoo()
bar.printBar()
Exemplo n.º 3
0
#!/bin/env python3


import car_in_abs 
from car_in_abs import Skoda as Mycar

from foo import Bar


skoda = car_in_abs.Skoda()
skoda.showName()

mycar = Mycar()
mycar.showName()

bar = Bar()
bar.hello()
Exemplo n.º 4
0
def test_copyable():
    copybar = Bar(UMSCM({"foo": 42, "bar": -1}))
    assert dict(copybar.m_map) == {"foo": 42, "bar": -1}
    copybar.m_map["foo"] = -1
    copybar.m_map["baz"] = 1337
    assert dict(copybar.m_map) == {"foo": -1, "bar": -1, "baz": 1337}
Exemplo n.º 5
0
def test_moveonly():
    movebar = Bar("foo", 42)  # this makes a MoveOnlyMemberMap
    assert movebar.m_map  # we can only assert that the member map exists
Exemplo n.º 6
0
 def test_bar_get(self):
     self.assertIsInstance(Bar.bar_get(), foo.Bar)