<s> import os <EOL> import io <EOL> import unittest <EOL> import json <EOL> from . import subscription <EOL> from . fhirdate import FHIRDate <EOL> class SubscriptionTests ( unittest . TestCase ) : <EOL> def instantiate_from ( self , filename ) : <EOL> datadir = os . environ . get ( '<STR_LIT>' ) or '<STR_LIT>' <EOL> with io . open ( os . path . join ( datadir , filename ) , '<STR_LIT:r>' , encoding = '<STR_LIT:utf-8>' ) as handle : <EOL> js = json . load ( handle ) <EOL> self . assertEqual ( "<STR_LIT>" , js [ "<STR_LIT>" ] ) <EOL> return subscription . Subscription ( js ) <EOL> def testSubscription1 ( self ) : <EOL> inst = self . instantiate_from ( "<STR_LIT>" ) <EOL> self . assertIsNotNone ( inst , "<STR_LIT>" ) <EOL> self . implSubscription1 ( inst ) <EOL> js = inst . as_json ( ) <EOL> self . assertEqual ( "<STR_LIT>" , js [ "<STR_LIT>" ] ) <EOL> inst2 = subscription . Subscription ( js ) <EOL> self . implSubscription1 ( inst2 ) <EOL> def implSubscription1 ( self , inst ) : <EOL> self . assertEqual ( inst . channel . endpoint , "<STR_LIT>" ) <EOL> self . assertEqual ( inst . channel . header , "<STR_LIT>" ) <EOL> self . assertEqual ( inst . channel . payload , "<STR_LIT:application/json>" ) <EOL> self . assertEqual ( inst . channel . type , "<STR_LIT>" ) <EOL> self . assertEqual ( inst . contact [ <NUM_LIT:0> ] . system , "<STR_LIT>" ) <EOL> self . assertEqual ( inst . contact [ <NUM_LIT:0> ] . value , "<STR_LIT>" ) <EOL> self . assertEqual ( inst . criteria , "<STR_LIT>" ) <EOL> self . assertEqual ( inst . end . date , FHIRDate ( "<STR_LIT>" ) . date ) <EOL> self . assertEqual ( inst . end . as_json ( ) , "<STR_LIT>" ) <EOL> self . assertEqual ( inst . error , "<STR_LIT>" ) <EOL> self . assertEqual ( inst . id , "<STR_LIT>" ) <EOL> self . assertEqual ( inst . reason , "<STR_LIT>" ) <EOL> self . assertEqual ( inst . status , "<STR_LIT:error>" ) <EOL> self . assertEqual ( inst . tag [ <NUM_LIT:0> ] . code , "<STR_LIT>" ) <EOL> self . assertEqual ( inst . tag [ <NUM_LIT:0> ] . system , "<STR_LIT>" ) <EOL> self . assertEqual ( inst . text . div , "<STR_LIT>" ) <EOL> self . assertEqual ( inst . text . status , "<STR_LIT>" ) <EOL> def testSubscription2 ( self ) : <EOL> inst = self . instantiate_from ( "<STR_LIT>" ) <EOL> self . assertIsNotNone ( inst , "<STR_LIT>" ) <EOL> self . implSubscription2 ( inst ) <EOL> js = inst . as_json ( ) <EOL> self . assertEqual ( "<STR_LIT>" , js [ "<STR_LIT>" ] ) <EOL> inst2 = subscription . Subscription ( js ) <EOL> self . implSubscription2 ( inst2 ) <EOL> def implSubscription2 ( self , inst ) : <EOL> self . assertEqual ( inst . channel . endpoint , "<STR_LIT>" ) <EOL> self . assertEqual ( inst . channel . header , "<STR_LIT>" ) <EOL> self . assertEqual ( inst . channel . payload , "<STR_LIT:application/json>" ) <EOL> self . assertEqual ( inst . channel . type , "<STR_LIT>" ) <EOL> self . assertEqual ( inst . contact [ <NUM_LIT:0> ] . system , "<STR_LIT>" ) <EOL> self . assertEqual ( inst . contact [ <NUM_LIT:0> ] . value , "<STR_LIT>" ) <EOL> self . assertEqual ( inst . criteria , "<STR_LIT>" ) <EOL> self . assertEqual ( inst . end . date , FHIRDate ( "<STR_LIT>" ) . date ) <EOL> self . assertEqual ( inst . end . as_json ( ) , "<STR_LIT>" ) <EOL> self . assertEqual ( inst . id , "<STR_LIT>" ) <EOL> self . assertEqual ( inst . reason , "<STR_LIT>" ) <EOL> self . assertEqual ( inst . status , "<STR_LIT>" ) <EOL> self . assertEqual ( inst . tag [ <NUM_LIT:0> ] . code , "<STR_LIT>" ) <EOL> self . assertEqual ( inst . tag [ <NUM_LIT:0> ] . system , "<STR_LIT>" ) <EOL> self . assertEqual ( inst . text . div , "<STR_LIT>" ) <EOL> self . assertEqual ( inst . text . status , "<STR_LIT>" ) </s>
