def test_new_invalid(): x = 1 with pytest.raises(TypeError): rinterface.SexpSymbol(x)
def test_new_str(): symbol = rinterface.SexpSymbol('pi') assert 'pi' == str(symbol)
def test_new_fromstring(): symbol = rinterface.SexpSymbol('pi') evalsymbol = rinterface.baseenv['eval'](symbol) assert evalsymbol.rid == rinterface.baseenv['pi'].rid
def test_new_missing(): with pytest.raises(TypeError): rinterface.SexpSymbol()
def testNew_str(self): symbol = rinterface.SexpSymbol("pi") self.assertEqual("pi", str(symbol))
def testNew_fromstring(self): symbol = rinterface.SexpSymbol("pi") evalsymbol = rinterface.baseenv['eval'](symbol) self.assertEqual(evalsymbol.rid, rinterface.baseenv['pi'].rid)