예제 #1
0
 def test_query_premisegroups(self):
     query = """
         query {
             premisegroups {
                 uid
                 author {
                     publicNickname
                 }
             }
         }
     """
     content = graphql_query(query)
     premisegroups = content.get("premisegroups")
     group = premisegroups[0]
     self.assertIsNotNone(group)
     self.assertIn('uid', group)
     self.assertIn('author', group)
     self.assertIsNotNone(group.get("author").get("publicNickname"))
예제 #2
0
 def test_query_premises(self):
     query = """
         query {
             premises {
                 uid
                 author {
                     publicNickname
                 }
             }
         }
     """
     content = graphql_query(query)
     premises = content.get("premises")
     premise = premises[0]
     self.assertIsNotNone(premise)
     self.assertIn('uid', premise)
     self.assertIn('author', premise)
     self.assertIsNotNone(premise.get("author").get("publicNickname"))
예제 #3
0
 def test_query_statement_reference(self):
     query = """
         query {
             statementReferences {
                 uid
                 users {
                     publicNickname
                 }
             }
         }
     """
     content = graphql_query(query)
     references = content.get("statementReferences")
     self.assertGreaterEqual(len(references), 1,
                             "statementReferences is empty")
     ref = references[0]
     self.assertIsNotNone(ref)
     self.assertIn('uid', ref)
     self.assertIn('users', ref)
     self.assertIsNotNone(ref.get("users").get("publicNickname"))
예제 #4
0
def test_query_arguments():
    query = """
        query {
            arguments {
                uid
                premisegroups {
                    uid
                }
                users {
                    publicNickname
                }
            }
        }
    """
    content = graphql_query(query)
    arguments = content.get("arguments")
    group = arguments[0]
    assert_is_not_none(group)
    assert_is_not_none(group.get("uid"))
    assert_is_not_none(group.get("users"))
    assert_is_not_none(group.get("users").get("publicNickname"))
    assert_is_not_none(group.get("premisegroups"))
    assert_is_not_none(group.get("premisegroups").get("uid"))
예제 #5
0
 def test_query_arguments(self):
     query = """
         query {
             arguments {
                 uid
                 premisegroup {
                     uid
                 }
                 author {
                     publicNickname
                 }
             }
         }
     """
     content = graphql_query(query)
     arguments = content.get("arguments")
     group = arguments[0]
     self.assertIsNotNone(group)
     self.assertIn('uid', group)
     self.assertIn('author', group)
     self.assertIn('publicNickname', group.get('author'))
     self.assertIn('premisegroup', group)
     self.assertIn('uid', group.get("premisegroup"))