Skip to content

Commit 9d2d1f6

Browse files
authored
Merge pull request #68 from CitrineInformatics/add-image
Add image for generating a filelink
2 parents e79823c + ed8c225 commit 9d2d1f6

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

taurus/demo/cake.py

+8
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@
4747
DEMO_SCOPE = 'citrine-demo'
4848

4949

50+
def import_toothpick_picture():
51+
"""Return the stream of the toothpick picture."""
52+
import pkg_resources
53+
resource = pkg_resources.resource_stream("taurus.demo", "toothpick.jpg")
54+
55+
return resource
56+
57+
5058
def make_cake_templates():
5159
"""Define all templates independently, as in the wild this will be an independent operation."""
5260
tmpl = dict()

taurus/demo/tests/test_cake.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from taurus.entity.object.ingredient_run import IngredientRun
1010

1111
from taurus.client.json_encoder import dumps, loads
12-
from taurus.demo.cake import make_cake
12+
from taurus.demo.cake import make_cake, import_toothpick_picture
1313
from taurus.util import recursive_foreach
1414
from taurus.entity.util import complete_material_history
1515

@@ -112,3 +112,8 @@ def check_ids(obj):
112112
assert obj.spec.material == obj.material.spec
113113
if obj.material:
114114
queue.append(obj.material)
115+
116+
117+
def test_import():
118+
"""Make sure picture import runs."""
119+
import_toothpick_picture()

taurus/demo/toothpick.jpg

26.2 KB
Loading

0 commit comments

Comments
 (0)