<s> import shopify <EOL> from test . test_helper import TestCase <EOL> class ArticleTest ( TestCase ) : <EOL> def test_create_article ( self ) : <EOL> self . fake ( "<STR_LIT>" , method = '<STR_LIT:POST>' , body = self . load_fixture ( '<STR_LIT>' ) , headers = { '<STR_LIT>' : '<STR_LIT:application/json>' } ) <EOL> article = shopify . Article ( { '<STR_LIT>' : <NUM_LIT> } ) <EOL> article . save ( ) <EOL> self . assertEqual ( "<STR_LIT>" , article . title ) <EOL> def test_get_article ( self ) : <EOL> self . fake ( '<STR_LIT>' , method = '<STR_LIT:GET>' , body = self . load_fixture ( '<STR_LIT>' ) ) <EOL> article = shopify . Article . find ( <NUM_LIT> ) <EOL> self . assertEqual ( "<STR_LIT>" , article . title ) <EOL> def test_update_article ( self ) : <EOL> self . fake ( '<STR_LIT>' , method = '<STR_LIT:GET>' , body = self . load_fixture ( '<STR_LIT>' ) ) <EOL> article = shopify . Article . find ( <NUM_LIT> ) <EOL> self . fake ( '<STR_LIT>' , method = '<STR_LIT>' , body = self . load_fixture ( '<STR_LIT>' ) , headers = { '<STR_LIT>' : '<STR_LIT:application/json>' } ) <EOL> article . save ( ) <EOL> def test_get_articles ( self ) : <EOL> self . fake ( "<STR_LIT>" , method = '<STR_LIT:GET>' , body = self . load_fixture ( '<STR_LIT>' ) ) <EOL> articles = shopify . Article . find ( ) <EOL> self . assertEqual ( <NUM_LIT:3> , len ( articles ) ) <EOL> def test_get_articles_namespaced ( self ) : <EOL> self . fake ( "<STR_LIT>" , method = '<STR_LIT:GET>' , body = self . load_fixture ( '<STR_LIT>' ) ) <EOL> articles = shopify . Article . find ( blog_id = <NUM_LIT> ) <EOL> self . assertEqual ( <NUM_LIT:3> , len ( articles ) ) <EOL> def test_get_article_namespaced ( self ) : <EOL> self . fake ( "<STR_LIT>" , method = '<STR_LIT:GET>' , body = self . load_fixture ( '<STR_LIT>' ) ) <EOL> article = shopify . Article . find ( <NUM_LIT> , blog_id = <NUM_LIT> ) <EOL> self . assertEqual ( "<STR_LIT>" , article . title ) <EOL> def test_get_authors ( self ) : <EOL> self . fake ( "<STR_LIT>" , method = '<STR_LIT:GET>' , body = self . load_fixture ( '<STR_LIT>' ) ) <EOL> authors = shopify . Article . authors ( ) <EOL> self . assertEqual ( "<STR_LIT>" , authors [ <NUM_LIT:0> ] ) <EOL> self . assertEqual ( "<STR_LIT>" , authors [ - <NUM_LIT:1> ] ) <EOL> def test_get_authors_for_blog_id ( self ) : <EOL> self . fake ( "<STR_LIT>" , method = '<STR_LIT:GET>' , body = self . load_fixture ( '<STR_LIT>' ) ) <EOL> authors = shopify . Article . authors ( blog_id = <NUM_LIT> ) <EOL> self . assertEqual ( <NUM_LIT:3> , len ( authors ) ) <EOL> def test_get_tags ( self ) : <EOL> self . fake ( "<STR_LIT>" , method = '<STR_LIT:GET>' , body = self . load_fixture ( '<STR_LIT>' ) ) <EOL> tags = shopify . Article . tags ( ) <EOL> self . assertEqual ( "<STR_LIT>" , tags [ <NUM_LIT:0> ] ) <EOL> self . assertEqual ( "<STR_LIT>" , tags [ - <NUM_LIT:1> ] ) <EOL> def test_get_tags_for_blog_id ( self ) : <EOL> self . fake ( "<STR_LIT>" , method = '<STR_LIT:GET>' , body = self . load_fixture ( '<STR_LIT>' ) ) <EOL> tags = shopify . Article . tags ( blog_id = <NUM_LIT> ) <EOL> self . assertEqual ( "<STR_LIT>" , tags [ <NUM_LIT:0> ] ) <EOL> self . assertEqual ( "<STR_LIT>" , tags [ - <NUM_LIT:1> ] ) <EOL> def test_get_popular_tags ( self ) : <EOL> self . fake ( "<STR_LIT>" , extension = False , method = '<STR_LIT:GET>' , body = self . load_fixture ( '<STR_LIT>' ) ) <EOL> tags = shopify . Article . tags ( popular = <NUM_LIT:1> , limit = <NUM_LIT:1> ) <EOL> self . assertEqual ( <NUM_LIT:3> , len ( tags ) ) </s>
