Esempio n. 1
0
 def testPOSIXlt_fromPythonTime(self):
     x = [
         time.struct_time(_dateval_tuple),
         time.struct_time(_dateval_tuple)
     ]
     res = robjects.POSIXlt(x)
     self.assertEqual(2, len(x))
Esempio n. 2
0
def test_POSIXlt_from_invalidpythontime():
    x = [time.struct_time(_dateval_tuple), time.struct_time(_dateval_tuple)]
    x.append('foo')
    with pytest.raises(ValueError):
        robjects.POSIXlt(x)
Esempio n. 3
0
def test_POSIXlt_getitem():
    x = [time.struct_time(_dateval_tuple), time.struct_time(_dateval_tuple)]
    res = robjects.POSIXlt(x)
    assert res[0] == x[0]
Esempio n. 4
0
def testPOSIXlt_repr():
    x = [time.struct_time(_dateval_tuple), time.struct_time(_dateval_tuple)]
    res = robjects.POSIXlt(x)
    s = repr(res)
    assert isinstance(s, str)
Esempio n. 5
0
def test_POSIXlt_from_pythontime():
    x = [time.struct_time(_dateval_tuple), time.struct_time(_dateval_tuple)]
    res = robjects.POSIXlt(x)
    assert len(x) == 2