~pythonxy/pythonxy-upstream/fiona

« back to all changes in this revision

Viewing changes to tests/test_fio_info.py

  • Committer: GitHub
  • Author(s): Sean Gillies
  • Date: 2016-06-14 04:12:30 UTC
  • mfrom: (354.2.6)
  • Revision ID: git-v1:d0ec8055372d2c896568f2295ff23c97d33e6c0f
Merge pull request #353 from micahcochran/appveyor

Add Appveyor for Windows CI.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
import json
2
2
from pkg_resources import iter_entry_points
3
3
import re
 
4
import sys
 
5
import unittest
4
6
 
5
7
from click.testing import CliRunner
6
8
 
9
11
 
10
12
WILDSHP = 'tests/data/coutwildrnp.shp'
11
13
 
 
14
FIXME_WINDOWS = sys.platform.startswith('win')
12
15
 
 
16
@unittest.skipIf(FIXME_WINDOWS, 
 
17
                 reason="FIXME on Windows. Please look into why this test is not working.")
13
18
def test_info_json():
14
19
    runner = CliRunner()
15
20
    result = runner.invoke(main_group, ['info', WILDSHP])
19
24
    assert '"driver": "ESRI Shapefile"' in result.output
20
25
    assert '"name": "coutwildrnp"' in result.output
21
26
 
22
 
 
 
27
@unittest.skipIf(FIXME_WINDOWS, 
 
28
                 reason="FIXME on Windows. Please look into why this test is not working.")
23
29
def test_info_count():
24
30
    runner = CliRunner()
25
31
    result = runner.invoke(main_group, ['info', '--count', WILDSHP])
26
32
    assert result.exit_code == 0
27
33
    assert result.output == "67\n"
28
34
 
29
 
 
 
35
@unittest.skipIf(FIXME_WINDOWS, 
 
36
                 reason="FIXME on Windows. Please look into why this test is not working.")
30
37
def test_info_bounds():
31
38
    runner = CliRunner()
32
39
    result = runner.invoke(main_group, ['info', '--bounds', WILDSHP])
47
54
    return lines
48
55
 
49
56
 
 
57
@unittest.skipIf(FIXME_WINDOWS, 
 
58
                 reason="FIXME on Windows. Please look into why this test is not working.")
50
59
def test_info_no_count():
51
60
    """Make sure we can still get a `$ fio info` report on datasources that do
52
61
    not support feature counting, AKA `len(collection)`.
59
68
    assert json.loads(lines[0])['count'] is None
60
69
 
61
70
 
 
71
@unittest.skipIf(FIXME_WINDOWS, 
 
72
                 reason="FIXME on Windows. Please look into why this test is not working.")
62
73
def test_info_layer():
63
74
    for layer in ('routes', '1'):
64
75
        runner = CliRunner()