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