Пример #1
0
def test_new_invalid():
    x = 1
    with pytest.raises(TypeError):
        rinterface.SexpSymbol(x)
Пример #2
0
def test_new_str():
    symbol = rinterface.SexpSymbol('pi')
    assert 'pi' == str(symbol)
Пример #3
0
def test_new_fromstring():
    symbol = rinterface.SexpSymbol('pi')
    evalsymbol = rinterface.baseenv['eval'](symbol)
    assert evalsymbol.rid == rinterface.baseenv['pi'].rid
Пример #4
0
def test_new_missing():
    with pytest.raises(TypeError):
        rinterface.SexpSymbol()
Пример #5
0
 def testNew_str(self):
     symbol = rinterface.SexpSymbol("pi")
     self.assertEqual("pi", str(symbol))
Пример #6
0
 def testNew_fromstring(self):
     symbol = rinterface.SexpSymbol("pi")
     evalsymbol = rinterface.baseenv['eval'](symbol)
     self.assertEqual(evalsymbol.rid, rinterface.baseenv['pi'].rid)