Browse Source

added Article.access_option

Fabian Peter Hammerle 6 years ago
parent
commit
6c083d9567
2 changed files with 7 additions and 0 deletions
  1. 4 0
      finoex/__init__.py
  2. 3 0
      tests/test_yaml.py

+ 4 - 0
finoex/__init__.py

@@ -338,6 +338,7 @@ class Article(Item):
     yaml_tag = u'!article'
 
     def __init__(self,
+                 access_option=None,
                  authors=None,
                  color=None,
                  delivery_date=None,
@@ -360,6 +361,9 @@ class Article(Item):
         if quantity is not None:
             assert type(quantity) is int
             self.quantity = quantity
+        if access_option is not None:
+            assert type(access_option) is str
+            self.access_option = access_option
         if authors is not None:
             assert type(authors) is list
             self.authors = authors

+ 3 - 0
tests/test_yaml.py

@@ -135,6 +135,7 @@ def get_contribution():
 
 def get_article():
     return finoex.Article(
+        access_option = 'download',
         authors = ['a', 'b'],
         depth = finoex.Distance(12.3, u'dm'),
         features = u'supergeil',
@@ -423,6 +424,7 @@ platform: platformπ
 platform_view_url: http://i.dont.know
 """],
     [get_article(), u"""!article
+access_option: download
 authors:
 - a
 - b
@@ -675,6 +677,7 @@ platform: platformπ
 platform_view_url: http://i.dont.know
 """],
     [get_article(), u"""!article
+access_option: download
 authors:
 - a
 - b