File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ """
2+ Tests for generated GraphQL query field selections.
3+ """
4+ import unittest
5+ from importlib import import_module
6+
7+
8+ queries = import_module ("thothlibrary.thoth-1_0_0.queries" )
9+
10+
11+ class QueryFieldTests (unittest .TestCase ):
12+ def test_work_full_fields_use_featured_video (self ):
13+ fields = " " .join (queries .WORK_FULL_FIELDS )
14+
15+ self .assertIn ("featuredVideo { workFeaturedVideoId" , fields )
16+ self .assertNotIn ("workFeaturedVideos {" , fields )
17+
18+ def test_work_list_fields_use_featured_video (self ):
19+ fields = " " .join (queries .WORK_LIST_FIELDS )
20+
21+ self .assertIn ("featuredVideo { workFeaturedVideoId" , fields )
22+ self .assertNotIn ("workFeaturedVideos {" , fields )
23+
24+
25+ if __name__ == "__main__" :
26+ unittest .main ()
Original file line number Diff line number Diff line change 129129 "text(markupFormat: JATS_XML) reviewOrdinal __typename }"
130130 ),
131131 (
132- "workFeaturedVideos { workFeaturedVideoId title url width height "
132+ "featuredVideo { workFeaturedVideoId title url width height "
133133 "file { fileId fileType cdnUrl __typename } __typename }"
134134 ),
135135 (
166166 "awards { awardId awardOrdinal __typename }" ,
167167 "endorsements { endorsementId endorsementOrdinal __typename }" ,
168168 "bookReviews { bookReviewId reviewOrdinal __typename }" ,
169- "workFeaturedVideos { workFeaturedVideoId title __typename }" ,
169+ "featuredVideo { workFeaturedVideoId title __typename }" ,
170170 "imprint { imprintId imprintName " + PUBLISHER_LINK + " __typename }" ,
171171 "__typename" ,
172172]
You can’t perform that action at this time.
0 commit comments