예제 #1
0
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")]
예제 #2
0
def test_init_invalid_no_time():
    with pytest.raises(TypeError):
        BehaviorFull("  171         Pot entry exit          either")
예제 #3
0
def test_init_invalid_no_frame():
    with pytest.raises(TypeError):
        BehaviorFull("       0:05.70    Pot entry exit          either")
예제 #4
0
def test_init_invalid_nonnumeric_time():
    with pytest.raises(TypeError):
        BehaviorFull("  171     a0:05.70    Pot entry exit          either")
예제 #5
0
def test_init_valid_negative_time():
    BehaviorFull("  171     -0:05.70    Pot entry exit          either")
예제 #6
0
def test_init_invalid_subject():
    with pytest.raises(TypeError):
        BehaviorFull("  171     0:05.70  Pot entry exit          both")
예제 #7
0
def test_init_valid_long_time():
    BehaviorFull("  171     0:01:05.70    Pot entry exit          either")
예제 #8
0
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
예제 #9
0
def test_init_invalid_raw_behavior():
    with pytest.raises(TypeError):
        BehaviorFull("53946     29:58.20     C")
예제 #10
0
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
예제 #11
0
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
예제 #12
0
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
예제 #13
0
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
예제 #14
0
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
예제 #15
0
def test_init_invalid_5_elems():
    with pytest.raises(TypeError):
        BehaviorFull("|  171   0:05.70  Pot entry exit   either  ")
예제 #16
0
def test_init_invalid_time_no_decimal_points():
    with pytest.raises(TypeError):
        BehaviorFull("  171     0:05:70    Pot entry exit          either")
예제 #17
0
def test_init_invalid_behavior():
    with pytest.raises(TypeError):
        BehaviorFull("  171     0:05.70  Pot entry exit!          either")
예제 #18
0
def test_init_invalid_no_description():
    with pytest.raises(TypeError):
        BehaviorFull("  171     0:05.70              either")
예제 #19
0
def test_init_valid_normal():
    BehaviorFull("  171     28:52.70    Pot entry exit          either")
예제 #20
0
def test_init_valid_negative_frame():
    BehaviorFull("  -171     0:05.70    Pot entry exit          either")
예제 #21
0
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
예제 #22
0
def test_constructor():
    log = Log()
    assert log.full == [BehaviorFull(" 0  00:00.00  null  either ")]
    assert log.marks == [Mark(0, timedelta(0), "")]