コード例 #1
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
コード例 #2
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
コード例 #3
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
コード例 #4
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
コード例 #5
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
コード例 #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
コード例 #7
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
コード例 #8
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)
コード例 #9
0
def test_environment_constructors ():

    instant = Instant.date_time(DateTime(2019, 1, 1, 0, 0, 0), Scale.UTC)
    objects = []

    env: Environment = Environment(instant, objects)

    assert env is not None
    assert isinstance(env, Environment)
コード例 #10
0
def test_instant_operators ():

    instant = Instant.J2000()

    assert (instant == instant) is not None
    assert (instant != instant) is not None


    assert (instant < instant) is not None
    assert (instant <= instant) is not None
    assert (instant > instant) is not None
    assert (instant >= instant) is not None

    assert (instant + Duration.seconds(1.0)) is not None
    assert (instant - Duration.seconds(1.0)) is not None

    assert (instant - instant) is not None

    instant += Duration.seconds(1.0)
    instant -= Duration.seconds(1.0)
コード例 #11
0
def test_instant_undefined ():

    assert Instant.undefined() is not None
コード例 #12
0
def test_interval_closed():

    assert Interval.closed(Instant.J2000(),
                           Instant.J2000() + Duration.minutes(1.0)) is not None
コード例 #13
0
def test_interval_constructors():

    assert Interval(Instant.J2000(),
                    Instant.J2000() + Duration.minutes(1.0),
                    Interval.Type.Closed) is not None
コード例 #14
0
def test_instant_now ():

    assert Instant.now() is not None
コード例 #15
0
def test_instant_J2000 ():

    assert Instant.J2000() is not None
コード例 #16
0
def test_instant_datetime ():

    assert Instant.date_time(DateTime(2018, 1, 1, 0, 0, 0, 0, 0, 0), Scale.UTC) is not None

    assert Instant.date_time(datetime.datetime.now(), Scale.UTC)
コード例 #17
0
def test_environment_setInstant():

    environment = Environment.default()

    environment.set_instant(
        Instant.date_time(DateTime(2019, 1, 1, 0, 0, 0), Scale.UTC))
コード例 #18
0
def test_instant_get_modified_julian_date ():

    assert Instant.J2000().get_modified_julian_date(Scale.UTC) is not None
コード例 #19
0
def test_instant_julian_date ():

    assert Instant.julian_date(2458119.5, Scale.UTC) is not None
コード例 #20
0
def test_instant_is_post_epoch ():

    assert Instant.J2000().is_post_epoch() is not None
コード例 #21
0
def test_instant_is_defined ():

    assert Instant.J2000().is_defined() is not None
コード例 #22
0
def test_instant_to_string ():

    assert Instant.J2000().to_string() is not None
    assert Instant.J2000().to_string(Scale.UTC) is not None
コード例 #23
0
def test_environment_constructors():

    instant = Instant.date_time(DateTime(2019, 1, 1, 0, 0, 0), Scale.UTC)
    objects = []

    assert Environment(instant, objects) is not None
コード例 #24
0
def test_instant_is_near ():

    assert Instant.J2000().is_near(Instant.J2000(), Duration.zero()) is not None
コード例 #25
0
def test_instant_modified_julian_date ():

    assert Instant.modified_julian_date(58119.0, Scale.UTC) is not None
コード例 #26
0
def test_duration_between():

    assert Duration.between(Instant.now(), Instant.now()) is not None
コード例 #27
0
def test_instant_get_date_time ():

    assert Instant.J2000().get_date_time(Scale.UTC) is not None