Mercurial > wikked
annotate tests/test_mock.py @ 243:c6ec6096bd95
Simpler out-of-the-box support for background updates.
Now by default Celery uses an SQLite broker, with storage in the `.wiki`
directory. This makes it possible to support async updates by simply passing
`--usetasks` to `wk runserver`, while also running `wk runtasks` in a different
process.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sat, 29 Mar 2014 22:28:07 -0700 |
parents | ebb12ff21cb2 |
children |
rev | line source |
---|---|
225
ebb12ff21cb2
Updated unit tests to be able to run.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
1 import pytest |
ebb12ff21cb2
Updated unit tests to be able to run.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
2 from .mock import MockFileSystem |
ebb12ff21cb2
Updated unit tests to be able to run.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
3 |
ebb12ff21cb2
Updated unit tests to be able to run.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
4 |
ebb12ff21cb2
Updated unit tests to be able to run.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
5 @pytest.mark.parametrize('flat, expected', [ |
ebb12ff21cb2
Updated unit tests to be able to run.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
6 ({}, {}), |
ebb12ff21cb2
Updated unit tests to be able to run.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
7 ({'/foo.txt': 'Bar'}, {'foo.txt': 'Bar'}), |
ebb12ff21cb2
Updated unit tests to be able to run.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
8 ({'/tmp/foo.txt': 'Bar'}, {'tmp': {'foo.txt': 'Bar'}}), |
ebb12ff21cb2
Updated unit tests to be able to run.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
9 ( |
ebb12ff21cb2
Updated unit tests to be able to run.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
10 {'/tmp/foo.txt': 'Bar', '/tmp/bar': 'Foo'}, |
ebb12ff21cb2
Updated unit tests to be able to run.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
11 {'tmp': {'foo.txt': 'Bar', 'bar': 'Foo'}})]) |
ebb12ff21cb2
Updated unit tests to be able to run.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
12 def test_flat_to_nested(flat, expected): |
ebb12ff21cb2
Updated unit tests to be able to run.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
13 actual = MockFileSystem.flat_to_nested(flat) |
ebb12ff21cb2
Updated unit tests to be able to run.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
14 assert actual == expected |