Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9fe9a3d

Browse files
committed
FakeRepository [fake_repo]
1 parenta1903fa commit9fe9a3d

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

‎test_services.py‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,23 @@
11
importpytest
2-
32
importmodel
3+
importrepository
44
importservices
55

66

7+
classFakeRepository(repository.AbstractRepository):
8+
def__init__(self,batches):
9+
self._batches=set(batches)
10+
11+
defadd(self,batch):
12+
self._batches.add(batch)
13+
14+
defget(self,reference):
15+
returnnext(bforbinself._batchesifb.reference==reference)
16+
17+
deflist(self):
18+
returnlist(self._batches)
19+
20+
721
deftest_returns_allocation():
822
line=model.OrderLine("o1","COMPLICATED-LAMP",10)
923
batch=model.Batch("b1","COMPLICATED-LAMP",100,eta=None)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp