Skip to content

Commit 199d824

Browse files
committed
test url sourcd
1 parent 469fd75 commit 199d824

File tree

4 files changed

+134
-0
lines changed

4 files changed

+134
-0
lines changed

.moban.d/cli-feature.rst.jj2

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,36 @@ Hightlighted features:
1111
#. Merge files in various excel file formats into one
1212
#. Split a multi-sheet excel file into single sheet files
1313
#. Find difference in data between two excel files
14+
15+
Usage
16+
================================================================================
17+
18+
Here is an example usage:
19+
20+
.. code-block:: bash
21+
22+
$ pyexcel view https://github.com/pyexcel/pyexcel-cli/blob/master/tests/fixtures/multiple-sheets.xls
23+
Sheet 1:
24+
+---+---+---+
25+
| 1 | 2 | 3 |
26+
+---+---+---+
27+
| 4 | 5 | 6 |
28+
+---+---+---+
29+
| 7 | 8 | 9 |
30+
+---+---+---+
31+
Sheet 2:
32+
+---+---+---+
33+
| X | Y | Z |
34+
+---+---+---+
35+
| 1 | 2 | 3 |
36+
+---+---+---+
37+
| 4 | 5 | 6 |
38+
+---+---+---+
39+
Sheet 3:
40+
+---+---+---+
41+
| O | P | Q |
42+
+---+---+---+
43+
| 3 | 2 | 1 |
44+
+---+---+---+
45+
| 4 | 3 | 2 |
46+
+---+---+---+

README.rst

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,39 @@ Hightlighted features:
2626
#. Split a multi-sheet excel file into single sheet files
2727
#. Find difference in data between two excel files
2828

29+
Usage
30+
================================================================================
31+
32+
Here is an example usage:
33+
34+
.. code-block:: bash
35+
36+
$ pyexcel view https://github.com/pyexcel/pyexcel-cli/blob/master/tests/fixtures/multiple-sheets.xls
37+
Sheet 1:
38+
+---+---+---+
39+
| 1 | 2 | 3 |
40+
+---+---+---+
41+
| 4 | 5 | 6 |
42+
+---+---+---+
43+
| 7 | 8 | 9 |
44+
+---+---+---+
45+
Sheet 2:
46+
+---+---+---+
47+
| X | Y | Z |
48+
+---+---+---+
49+
| 1 | 2 | 3 |
50+
+---+---+---+
51+
| 4 | 5 | 6 |
52+
+---+---+---+
53+
Sheet 3:
54+
+---+---+---+
55+
| O | P | Q |
56+
+---+---+---+
57+
| 3 | 2 | 1 |
58+
+---+---+---+
59+
| 4 | 3 | 2 |
60+
+---+---+---+
61+
2962
.. _file-format-list:
3063

3164
.. table:: A list of file formats supported by external plugins

docs/source/index.rst

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,39 @@ Hightlighted features:
2525
#. Split a multi-sheet excel file into single sheet files
2626
#. Find difference in data between two excel files
2727

28+
Usage
29+
================================================================================
30+
31+
Here is an example usage:
32+
33+
.. code-block:: bash
34+
35+
$ pyexcel view https://github.com/pyexcel/pyexcel-cli/blob/master/tests/fixtures/multiple-sheets.xls
36+
Sheet 1:
37+
+---+---+---+
38+
| 1 | 2 | 3 |
39+
+---+---+---+
40+
| 4 | 5 | 6 |
41+
+---+---+---+
42+
| 7 | 8 | 9 |
43+
+---+---+---+
44+
Sheet 2:
45+
+---+---+---+
46+
| X | Y | Z |
47+
+---+---+---+
48+
| 1 | 2 | 3 |
49+
+---+---+---+
50+
| 4 | 5 | 6 |
51+
+---+---+---+
52+
Sheet 3:
53+
+---+---+---+
54+
| O | P | Q |
55+
+---+---+---+
56+
| 3 | 2 | 1 |
57+
+---+---+---+
58+
| 4 | 3 | 2 |
59+
+---+---+---+
60+
2861
Installation
2962
================================================================================
3063

tests/test_view.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from nose.tools import eq_
33
from pyexcel_cli.view import view
44
from click.testing import CliRunner
5+
from textwrap import dedent
56

67

78
def test_stdin_option():
@@ -23,3 +24,37 @@ def test_stdout_option():
2324
test_fixture])
2425
eq_(result.exit_code, 0)
2526
eq_(result.output, '1,2,3\n')
27+
28+
29+
def test_url_option():
30+
runner = CliRunner()
31+
test_fixture = "https://github.com/pyexcel/pyexcel-cli/raw/master/tests/fixtures/multiple-sheets.xls" # noqa
32+
result = runner.invoke(view, [test_fixture])
33+
expected = dedent("""
34+
Sheet 1:
35+
+---+---+---+
36+
| 1 | 2 | 3 |
37+
+---+---+---+
38+
| 4 | 5 | 6 |
39+
+---+---+---+
40+
| 7 | 8 | 9 |
41+
+---+---+---+
42+
Sheet 2:
43+
+---+---+---+
44+
| X | Y | Z |
45+
+---+---+---+
46+
| 1 | 2 | 3 |
47+
+---+---+---+
48+
| 4 | 5 | 6 |
49+
+---+---+---+
50+
Sheet 3:
51+
+---+---+---+
52+
| O | P | Q |
53+
+---+---+---+
54+
| 3 | 2 | 1 |
55+
+---+---+---+
56+
| 4 | 3 | 2 |
57+
+---+---+---+
58+
""").strip('\n')
59+
eq_(result.exit_code, 0)
60+
eq_(result.output, expected)

0 commit comments

Comments
 (0)