Exemple #1
0
def test_interval_intersects():

    interval = Interval(Instant.J2000(),
                        Instant.J2000() + Duration.minutes(1.0),
                        Interval.Type.Closed)

    assert interval.intersects(interval) is not None
Exemple #2
0
def test_interval_contains_instant():

    interval = Interval(Instant.J2000(),
                        Instant.J2000() + Duration.minutes(1.0),
                        Interval.Type.Closed)

    assert interval.contains_instant(Instant.J2000()) is not None
Exemple #3
0
def test_interval_generate_grid():

    interval = Interval(Instant.J2000(),
                        Instant.J2000() + Duration.minutes(1.0),
                        Interval.Type.Closed)

    assert interval.generate_grid(Duration.seconds(1.0)) is not None
Exemple #4
0
def test_interval_is_degenerate():

    interval = Interval(Instant.J2000(),
                        Instant.J2000() + Duration.minutes(1.0),
                        Interval.Type.Closed)

    assert interval.is_degenerate() is not None
Exemple #5
0
def test_interval_get_center():

    interval = Interval(Instant.J2000(),
                        Instant.J2000() + Duration.minutes(1.0),
                        Interval.Type.Closed)

    assert interval.get_center() is not None
Exemple #6
0
def test_interval_to_string():

    interval = Interval(Instant.J2000(),
                        Instant.J2000() + Duration.minutes(1.0),
                        Interval.Type.Closed)

    assert interval.to_string() is not None
    assert interval.to_string(Scale.UTC) is not None
Exemple #7
0
def test_interval_generate_grid ():

    interval = Interval(Instant.J2000(), Instant.J2000() + Duration.minutes(1.0), Interval.Type.Closed)

    grid = interval.generate_grid(Duration.seconds(1.0))

    assert grid is not None
    assert isinstance(grid, list)
    assert isinstance(grid[0], Instant)
Exemple #8
0
def test_interval_operators():

    interval = Interval(Instant.J2000(),
                        Instant.J2000() + Duration.minutes(1.0),
                        Interval.Type.Closed)

    assert (interval == interval) is not None
    assert (interval != interval) is not None
Exemple #9
0
def test_interval_closed():

    assert Interval.closed(Instant.J2000(),
                           Instant.J2000() + Duration.minutes(1.0)) is not None
Exemple #10
0
def test_interval_undefined():

    assert Interval.undefined() is not None
Exemple #11
0
def test_interval_constructors():

    assert Interval(Instant.J2000(),
                    Instant.J2000() + Duration.minutes(1.0),
                    Interval.Type.Closed) is not None