Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
autra committed Jan 20, 2020
1 parent 7b55f39 commit 4b70246
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
Binary file added tests/fixtures/without_srs.las
Binary file not shown.
17 changes: 15 additions & 2 deletions tests/test_convert.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-
import os
from pytest import approx
from pytest import approx, raises
import shutil

from py3dtiles import convert_to_ecef
from py3dtiles.convert import convert
from py3dtiles.convert import convert, SrsInMissingException


def test_convert_to_ecef():
Expand All @@ -26,4 +26,17 @@ def test_convert():
shutil.rmtree('./tmp')


def test_convert_without_srs():
with raises(SrsInMissingException):
convert(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'fixtures', 'without_srs.las'),
outfolder='./tmp',
srs_out='4978')
assert not os.path.exists(os.path.join('tmp'))

convert(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'fixtures', 'without_srs.las'),
outfolder='./tmp',
srs_in='3949',
srs_out='4978')
assert os.path.exists(os.path.join('tmp', 'tileset.json'))
assert os.path.exists(os.path.join('tmp', 'r.pnts'))
shutil.rmtree('./tmp')

0 comments on commit 4b70246

Please sign in to comment.