def test_from_rawlog(): str_full = " 0 00:00.00 null either " str_mark = " 1 0:00.03 video start" rawlog = RawLog() rawlog.full.append(str_full) rawlog.marks.append(str_mark) log = Log.from_raw_log(rawlog) assert log.full == [BehaviorFull(" 0 00:00.00 null either ")] assert log.marks == [Mark.from_line(" 1 0:00.03 video start")]
def test_init_invalid_no_time(): with pytest.raises(TypeError): BehaviorFull(" 171 Pot entry exit either")
def test_init_invalid_no_frame(): with pytest.raises(TypeError): BehaviorFull(" 0:05.70 Pot entry exit either")
def test_init_invalid_nonnumeric_time(): with pytest.raises(TypeError): BehaviorFull(" 171 a0:05.70 Pot entry exit either")
def test_init_valid_negative_time(): BehaviorFull(" 171 -0:05.70 Pot entry exit either")
def test_init_invalid_subject(): with pytest.raises(TypeError): BehaviorFull(" 171 0:05.70 Pot entry exit both")
def test_init_valid_long_time(): BehaviorFull(" 171 0:01:05.70 Pot entry exit either")
def test_lt_equal(): one = BehaviorFull(" 171 0:01:05.70 Pot entry exit either") two = BehaviorFull(" 171 0:01:05.70 Pot entry exit either") assert one >= two
def test_init_invalid_raw_behavior(): with pytest.raises(TypeError): BehaviorFull("53946 29:58.20 C")
def test_lt_description_lexicographic(): one = BehaviorFull(" 171 0:01:05.70 Pot entry exit either") two = BehaviorFull(" 171 0:01:05.70 pot entry exit either") assert one < two
def test_lt_subject_lexicographic(): one = BehaviorFull(" 171 0:01:05.70 Pot entry exit either") one.subject = "Either" # Needed to avoid validator rejecting subject two = BehaviorFull(" 171 0:01:05.70 Pot entry exit either") assert one < two
def test_lt_description(): one = BehaviorFull(" 171 0:01:05.70 Aot entry exit either") two = BehaviorFull(" 171 0:01:05.70 Pot entry exit either") assert one < two
def test_lt_time_both_signs(): one = BehaviorFull(" 171 -0:01:05.70 Pot entry exit either") two = BehaviorFull(" 171 0:01:05.70 Pot entry exit either") assert one < two
def test_lt_time_negative(): one = BehaviorFull(" 171 -0:01:05.70 Pot entry exit either") two = BehaviorFull(" 171 -0:00:05.70 Pot entry exit either") assert one < two
def test_init_invalid_5_elems(): with pytest.raises(TypeError): BehaviorFull("| 171 0:05.70 Pot entry exit either ")
def test_init_invalid_time_no_decimal_points(): with pytest.raises(TypeError): BehaviorFull(" 171 0:05:70 Pot entry exit either")
def test_init_invalid_behavior(): with pytest.raises(TypeError): BehaviorFull(" 171 0:05.70 Pot entry exit! either")
def test_init_invalid_no_description(): with pytest.raises(TypeError): BehaviorFull(" 171 0:05.70 either")
def test_init_valid_normal(): BehaviorFull(" 171 28:52.70 Pot entry exit either")
def test_init_valid_negative_frame(): BehaviorFull(" -171 0:05.70 Pot entry exit either")
def test_lt_frame_positive(): one = BehaviorFull(" 171 0:01:05.70 Pot entry exit either") two = BehaviorFull(" 173 0:01:05.70 Pot entry exit either") assert one < two
def test_constructor(): log = Log() assert log.full == [BehaviorFull(" 0 00:00.00 null either ")] assert log.marks == [Mark(0, timedelta(0), "")]