Esempio n. 1
0
def test_get_replication_header_empty(tmp_path):
    fn = tmp_path / 'test.opl'
    fn.write_text('n6365 v1 c63965061 t2018-10-29T03:56:07Z i8369524 ux x1 y7')

    val = rutil.get_replication_header(str(fn))
    assert val.url is None
    assert val.sequence is None
    assert val.timestamp is None
Esempio n. 2
0
    def check_osmium_diff(self, conf):
        self.logger.log("check osmium replication")
        pbf_file = conf.download["dst"]
        from osmium.replication.utils import get_replication_header  # type: ignore

        # check if osmosis_* headers for replication are present
        url, seq, ts = get_replication_header(pbf_file)
        if url is None or seq is None or ts is None:
            return False

        return True
Esempio n. 3
0
def test_get_replication_header_empty():
    data = [osmobj('N', id=1, version=1, changeset=63965061, uid=8369524,
                   timestamp='2018-10-29T03:56:07Z', user='******')]
    fn = create_osm_file(data)

    try:
        val = rutil.get_replication_header(fn)
        assert_is_none(val.url)
        assert_is_none(val.sequence)
        assert_is_none(val.timestamp)
    finally:
        os.remove(fn)
Esempio n. 4
0
def test_get_replication_header_empty():
    data = [
        osmobj('N',
               id=1,
               version=1,
               changeset=63965061,
               uid=8369524,
               timestamp='2018-10-29T03:56:07Z',
               user='******')
    ]
    fn = create_osm_file(data)

    try:
        val = rutil.get_replication_header(fn)
        assert_is_none(val.url)
        assert_is_none(val.sequence)
        assert_is_none(val.timestamp)
    finally:
        os.remove(fn)
Esempio n. 5
0
def test_get_replication_header_full(test_data_dir):
    val = rutil.get_replication_header(str(test_data_dir / 'example-test.pbf'))

    assert val.url == 'http://download.geofabrik.de/europe/andorra-updates'
    assert val.sequence == 2167
    assert val.timestamp == mkdate(2019, 2, 23, 21, 15, 2)