Exemple #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))
Exemple #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)
Exemple #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]
Exemple #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)
Exemple #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