meta_oxide 0.1.1

Universal metadata extraction library supporting 13 formats (HTML Meta, Open Graph, Twitter Cards, JSON-LD, Microdata, Microformats, RDFa, Dublin Core, Web App Manifest, oEmbed, rel-links, Images, SEO) with 7 language bindings
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
"""
Tests for JSON-LD Movie type

Tests the extraction of Schema.org Movie structured data
"""

import meta_oxide
import pytest


class TestMovieBasic:
    """Test basic Movie extraction"""

    def test_movie_minimal(self):
        """Test minimal movie with name only"""
        html = """
        <html>
        <head>
            <script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@type": "Movie",
                "name": "The Example Film"
            }
            </script>
        </head>
        <body></body>
        </html>
        """

        objects = meta_oxide.extract_jsonld(html)

        assert len(objects) == 1
        assert objects[0]["@type"] == "Movie"
        assert objects[0]["name"] == "The Example Film"

    def test_movie_with_description(self):
        """Test movie with name and description"""
        html = """
        <html>
        <head>
            <script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@type": "Movie",
                "name": "Epic Adventure",
                "description": "An epic tale of adventure and discovery"
            }
            </script>
        </head>
        <body></body>
        </html>
        """

        objects = meta_oxide.extract_jsonld(html)

        assert len(objects) == 1
        assert objects[0]["@type"] == "Movie"
        assert objects[0]["name"] == "Epic Adventure"
        assert objects[0]["description"] == "An epic tale of adventure and discovery"

    def test_movie_with_duration(self):
        """Test movie with ISO 8601 duration"""
        html = """
        <html>
        <head>
            <script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@type": "Movie",
                "name": "Feature Length Film",
                "duration": "PT2H15M"
            }
            </script>
        </head>
        <body></body>
        </html>
        """

        objects = meta_oxide.extract_jsonld(html)

        assert len(objects) == 1
        assert objects[0]["@type"] == "Movie"
        assert objects[0]["name"] == "Feature Length Film"
        assert objects[0]["duration"] == "PT2H15M"

    def test_movie_with_url_and_image(self):
        """Test movie with url and image"""
        html = """
        <html>
        <head>
            <script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@type": "Movie",
                "name": "Visual Masterpiece",
                "url": "https://example.com/movie/visual-masterpiece",
                "image": "https://example.com/posters/masterpiece.jpg"
            }
            </script>
        </head>
        <body></body>
        </html>
        """

        objects = meta_oxide.extract_jsonld(html)

        assert len(objects) == 1
        assert objects[0]["@type"] == "Movie"
        assert objects[0]["url"] == "https://example.com/movie/visual-masterpiece"
        assert objects[0]["image"] == "https://example.com/posters/masterpiece.jpg"


class TestMoviePeople:
    """Test Movie people fields (director, actor, producer)"""

    def test_movie_with_single_director(self):
        """Test movie with single director as Person object"""
        html = """
        <html>
        <head>
            <script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@type": "Movie",
                "name": "Directorial Vision",
                "director": {
                    "@type": "Person",
                    "name": "Christopher Nolan"
                }
            }
            </script>
        </head>
        <body></body>
        </html>
        """

        objects = meta_oxide.extract_jsonld(html)

        assert len(objects) == 1
        assert objects[0]["@type"] == "Movie"
        assert objects[0]["name"] == "Directorial Vision"
        # Complex objects are returned as JSON strings per codebase pattern
        assert "director" in objects[0]

    def test_movie_with_multiple_directors(self):
        """Test movie with multiple directors"""
        html = """
        <html>
        <head>
            <script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@type": "Movie",
                "name": "Co-Directed Film",
                "director": [
                    {
                        "@type": "Person",
                        "name": "Lana Wachowski"
                    },
                    {
                        "@type": "Person",
                        "name": "Lilly Wachowski"
                    }
                ]
            }
            </script>
        </head>
        <body></body>
        </html>
        """

        objects = meta_oxide.extract_jsonld(html)

        assert len(objects) == 1
        assert objects[0]["@type"] == "Movie"
        assert objects[0]["name"] == "Co-Directed Film"
        assert "director" in objects[0]

    def test_movie_with_single_actor(self):
        """Test movie with single actor"""
        html = """
        <html>
        <head>
            <script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@type": "Movie",
                "name": "One Person Show",
                "actor": {
                    "@type": "Person",
                    "name": "Tom Hanks"
                }
            }
            </script>
        </head>
        <body></body>
        </html>
        """

        objects = meta_oxide.extract_jsonld(html)

        assert len(objects) == 1
        assert objects[0]["@type"] == "Movie"
        assert "actor" in objects[0]

    def test_movie_with_multiple_actors(self):
        """Test movie with multiple actors"""
        html = """
        <html>
        <head>
            <script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@type": "Movie",
                "name": "Ensemble Cast",
                "actor": [
                    {
                        "@type": "Person",
                        "name": "Leonardo DiCaprio"
                    },
                    {
                        "@type": "Person",
                        "name": "Tom Hardy"
                    },
                    {
                        "@type": "Person",
                        "name": "Elliot Page"
                    }
                ]
            }
            </script>
        </head>
        <body></body>
        </html>
        """

        objects = meta_oxide.extract_jsonld(html)

        assert len(objects) == 1
        assert objects[0]["@type"] == "Movie"
        assert objects[0]["name"] == "Ensemble Cast"
        assert "actor" in objects[0]

    def test_movie_with_producer_and_author(self):
        """Test movie with producer and author (screenwriter)"""
        html = """
        <html>
        <head>
            <script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@type": "Movie",
                "name": "Production Credits",
                "producer": {
                    "@type": "Person",
                    "name": "Emma Thomas"
                },
                "author": {
                    "@type": "Person",
                    "name": "Aaron Sorkin"
                }
            }
            </script>
        </head>
        <body></body>
        </html>
        """

        objects = meta_oxide.extract_jsonld(html)

        assert len(objects) == 1
        assert objects[0]["@type"] == "Movie"
        assert "producer" in objects[0]
        assert "author" in objects[0]


class TestMovieMetadata:
    """Test Movie metadata fields"""

    def test_movie_with_genre(self):
        """Test movie with genre"""
        html = """
        <html>
        <head>
            <script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@type": "Movie",
                "name": "Sci-Fi Thriller",
                "genre": ["Science Fiction", "Thriller", "Drama"]
            }
            </script>
        </head>
        <body></body>
        </html>
        """

        objects = meta_oxide.extract_jsonld(html)

        assert len(objects) == 1
        assert objects[0]["@type"] == "Movie"
        assert objects[0]["name"] == "Sci-Fi Thriller"
        assert "genre" in objects[0]

    def test_movie_with_content_rating(self):
        """Test movie with content rating"""
        html = """
        <html>
        <head>
            <script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@type": "Movie",
                "name": "Teen Adventure",
                "contentRating": "PG-13"
            }
            </script>
        </head>
        <body></body>
        </html>
        """

        objects = meta_oxide.extract_jsonld(html)

        assert len(objects) == 1
        assert objects[0]["@type"] == "Movie"
        assert objects[0]["contentRating"] == "PG-13"

    def test_movie_with_dates(self):
        """Test movie with datePublished and dateCreated"""
        html = """
        <html>
        <head>
            <script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@type": "Movie",
                "name": "Historical Release",
                "datePublished": "2010-07-16",
                "dateCreated": "2009-12-01"
            }
            </script>
        </head>
        <body></body>
        </html>
        """

        objects = meta_oxide.extract_jsonld(html)

        assert len(objects) == 1
        assert objects[0]["@type"] == "Movie"
        assert objects[0]["datePublished"] == "2010-07-16"
        assert objects[0]["dateCreated"] == "2009-12-01"

    def test_movie_with_language_and_country(self):
        """Test movie with inLanguage and countryOfOrigin"""
        html = """
        <html>
        <head>
            <script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@type": "Movie",
                "name": "International Film",
                "inLanguage": "en",
                "countryOfOrigin": "USA"
            }
            </script>
        </head>
        <body></body>
        </html>
        """

        objects = meta_oxide.extract_jsonld(html)

        assert len(objects) == 1
        assert objects[0]["@type"] == "Movie"
        assert objects[0]["inLanguage"] == "en"
        assert objects[0]["countryOfOrigin"] == "USA"


class TestMovieRatingsReviews:
    """Test Movie ratings and reviews"""

    def test_movie_with_aggregate_rating(self):
        """Test movie with aggregateRating"""
        html = """
        <html>
        <head>
            <script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@type": "Movie",
                "name": "Highly Rated Film",
                "aggregateRating": {
                    "@type": "AggregateRating",
                    "ratingValue": "8.8",
                    "ratingCount": "2500000",
                    "bestRating": "10",
                    "worstRating": "1"
                }
            }
            </script>
        </head>
        <body></body>
        </html>
        """

        objects = meta_oxide.extract_jsonld(html)

        assert len(objects) == 1
        assert objects[0]["@type"] == "Movie"
        assert objects[0]["name"] == "Highly Rated Film"
        assert "aggregateRating" in objects[0]

    def test_movie_with_review(self):
        """Test movie with review"""
        html = """
        <html>
        <head>
            <script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@type": "Movie",
                "name": "Critically Acclaimed",
                "review": {
                    "@type": "Review",
                    "author": {
                        "@type": "Person",
                        "name": "Roger Ebert"
                    },
                    "reviewRating": {
                        "@type": "Rating",
                        "ratingValue": "4"
                    },
                    "reviewBody": "A masterpiece of modern cinema."
                }
            }
            </script>
        </head>
        <body></body>
        </html>
        """

        objects = meta_oxide.extract_jsonld(html)

        assert len(objects) == 1
        assert objects[0]["@type"] == "Movie"
        assert objects[0]["name"] == "Critically Acclaimed"
        assert "review" in objects[0]

    def test_movie_with_multiple_reviews(self):
        """Test movie with multiple reviews"""
        html = """
        <html>
        <head>
            <script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@type": "Movie",
                "name": "Well Reviewed",
                "review": [
                    {
                        "@type": "Review",
                        "author": {"@type": "Person", "name": "Critic One"},
                        "reviewRating": {"@type": "Rating", "ratingValue": "5"}
                    },
                    {
                        "@type": "Review",
                        "author": {"@type": "Person", "name": "Critic Two"},
                        "reviewRating": {"@type": "Rating", "ratingValue": "4"}
                    }
                ]
            }
            </script>
        </head>
        <body></body>
        </html>
        """

        objects = meta_oxide.extract_jsonld(html)

        assert len(objects) == 1
        assert objects[0]["@type"] == "Movie"
        assert "review" in objects[0]


class TestMovieProduction:
    """Test Movie production fields"""

    def test_movie_with_production_company(self):
        """Test movie with productionCompany"""
        html = """
        <html>
        <head>
            <script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@type": "Movie",
                "name": "Studio Production",
                "productionCompany": {
                    "@type": "Organization",
                    "name": "Warner Bros. Pictures"
                }
            }
            </script>
        </head>
        <body></body>
        </html>
        """

        objects = meta_oxide.extract_jsonld(html)

        assert len(objects) == 1
        assert objects[0]["@type"] == "Movie"
        assert objects[0]["name"] == "Studio Production"
        assert "productionCompany" in objects[0]

    def test_movie_with_music_and_awards(self):
        """Test movie with musicBy and awards"""
        html = """
        <html>
        <head>
            <script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@type": "Movie",
                "name": "Award Winner",
                "musicBy": {
                    "@type": "Person",
                    "name": "Hans Zimmer"
                },
                "awards": "Academy Award for Best Picture"
            }
            </script>
        </head>
        <body></body>
        </html>
        """

        objects = meta_oxide.extract_jsonld(html)

        assert len(objects) == 1
        assert objects[0]["@type"] == "Movie"
        assert objects[0]["name"] == "Award Winner"
        assert "musicBy" in objects[0]
        assert objects[0]["awards"] == "Academy Award for Best Picture"

    def test_movie_with_trailer(self):
        """Test movie with trailer (VideoObject)"""
        html = """
        <html>
        <head>
            <script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@type": "Movie",
                "name": "Upcoming Release",
                "trailer": {
                    "@type": "VideoObject",
                    "name": "Official Trailer",
                    "url": "https://example.com/trailer",
                    "thumbnailUrl": "https://example.com/trailer-thumb.jpg"
                }
            }
            </script>
        </head>
        <body></body>
        </html>
        """

        objects = meta_oxide.extract_jsonld(html)

        assert len(objects) == 1
        assert objects[0]["@type"] == "Movie"
        assert objects[0]["name"] == "Upcoming Release"
        assert "trailer" in objects[0]


class TestMovieRealWorld:
    """Test with real-world Movie examples"""

    def test_movie_blockbuster(self):
        """Test blockbuster movie with comprehensive metadata"""
        html = """
        <html>
        <head>
            <script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@type": "Movie",
                "name": "Inception",
                "description": "A thief who steals corporate secrets through the use of dream-sharing technology",
                "url": "https://example.com/movies/inception",
                "image": "https://example.com/posters/inception.jpg",
                "director": {
                    "@type": "Person",
                    "name": "Christopher Nolan"
                },
                "actor": [
                    {"@type": "Person", "name": "Leonardo DiCaprio"},
                    {"@type": "Person", "name": "Joseph Gordon-Levitt"},
                    {"@type": "Person", "name": "Elliot Page"}
                ],
                "genre": ["Science Fiction", "Action", "Thriller"],
                "datePublished": "2010-07-16",
                "duration": "PT2H28M",
                "contentRating": "PG-13",
                "aggregateRating": {
                    "@type": "AggregateRating",
                    "ratingValue": "8.8",
                    "ratingCount": "2300000"
                },
                "productionCompany": {
                    "@type": "Organization",
                    "name": "Warner Bros. Pictures"
                },
                "musicBy": {
                    "@type": "Person",
                    "name": "Hans Zimmer"
                },
                "countryOfOrigin": "USA",
                "inLanguage": "en"
            }
            </script>
        </head>
        <body></body>
        </html>
        """

        objects = meta_oxide.extract_jsonld(html)

        assert len(objects) == 1
        movie = objects[0]

        assert movie["@type"] == "Movie"
        assert movie["name"] == "Inception"
        assert (
            movie["description"]
            == "A thief who steals corporate secrets through the use of dream-sharing technology"
        )
        assert movie["url"] == "https://example.com/movies/inception"
        assert movie["image"] == "https://example.com/posters/inception.jpg"
        assert movie["datePublished"] == "2010-07-16"
        assert movie["duration"] == "PT2H28M"
        assert movie["contentRating"] == "PG-13"
        assert movie["countryOfOrigin"] == "USA"
        assert movie["inLanguage"] == "en"
        assert "director" in movie
        assert "actor" in movie
        assert "genre" in movie
        assert "aggregateRating" in movie
        assert "productionCompany" in movie
        assert "musicBy" in movie

    def test_movie_indie_film(self):
        """Test indie film with minimal but essential data"""
        html = """
        <html>
        <head>
            <script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@type": "Movie",
                "name": "Moonlight",
                "description": "A coming-of-age story of a young African-American man",
                "director": {
                    "@type": "Person",
                    "name": "Barry Jenkins"
                },
                "datePublished": "2016-10-21",
                "duration": "PT1H51M",
                "genre": "Drama",
                "awards": "Academy Award for Best Picture",
                "contentRating": "R"
            }
            </script>
        </head>
        <body></body>
        </html>
        """

        objects = meta_oxide.extract_jsonld(html)

        assert len(objects) == 1
        assert objects[0]["@type"] == "Movie"
        assert objects[0]["name"] == "Moonlight"
        assert objects[0]["duration"] == "PT1H51M"
        assert objects[0]["contentRating"] == "R"
        assert objects[0]["awards"] == "Academy Award for Best Picture"
        assert "director" in objects[0]

    def test_movie_documentary(self):
        """Test documentary film"""
        html = """
        <html>
        <head>
            <script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@type": "Movie",
                "name": "Planet Earth II",
                "description": "David Attenborough returns to narrate this landmark series",
                "genre": "Documentary",
                "datePublished": "2016-11-06",
                "duration": "PT8H",
                "contentRating": "TV-G",
                "director": {
                    "@type": "Person",
                    "name": "Various"
                },
                "productionCompany": {
                    "@type": "Organization",
                    "name": "BBC Natural History Unit"
                }
            }
            </script>
        </head>
        <body></body>
        </html>
        """

        objects = meta_oxide.extract_jsonld(html)

        assert len(objects) == 1
        assert objects[0]["@type"] == "Movie"
        assert objects[0]["name"] == "Planet Earth II"
        assert objects[0]["duration"] == "PT8H"
        assert objects[0]["contentRating"] == "TV-G"
        assert "genre" in objects[0]


class TestMovieEdgeCases:
    """Test edge cases for Movie"""

    def test_movie_empty_optional_fields(self):
        """Test that optional fields can be omitted"""
        html = """
        <html>
        <head>
            <script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@type": "Movie",
                "name": "Minimal Movie"
            }
            </script>
        </head>
        <body></body>
        </html>
        """

        objects = meta_oxide.extract_jsonld(html)

        assert len(objects) == 1
        assert objects[0]["@type"] == "Movie"
        assert objects[0]["name"] == "Minimal Movie"
        # Optional fields should not be present if not provided
        assert "description" not in objects[0]
        assert "duration" not in objects[0]
        assert "director" not in objects[0]

    def test_movie_in_graph(self):
        """Test Movie within @graph"""
        html = """
        <html>
        <head>
            <script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@graph": [
                    {
                        "@type": "Movie",
                        "name": "First Movie"
                    },
                    {
                        "@type": "Movie",
                        "name": "Second Movie"
                    }
                ]
            }
            </script>
        </head>
        <body></body>
        </html>
        """

        objects = meta_oxide.extract_jsonld(html)

        assert len(objects) == 2
        assert objects[0]["@type"] == "Movie"
        assert objects[0]["name"] == "First Movie"
        assert objects[1]["@type"] == "Movie"
        assert objects[1]["name"] == "Second Movie"


class TestMovieIntegration:
    """Test Movie integration with extract_all()"""

    def test_extract_all_includes_movie(self):
        """Test that extract_all() includes Movie"""
        html = """
        <html>
        <head>
            <title>Movie Page</title>
            <meta property="og:title" content="OG Title">
            <script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@type": "Movie",
                "name": "Test Movie",
                "description": "A test movie for integration"
            }
            </script>
        </head>
        <body></body>
        </html>
        """

        data = meta_oxide.extract_all(html)

        assert "meta" in data
        assert "opengraph" in data
        assert "jsonld" in data

        assert len(data["jsonld"]) == 1
        assert data["jsonld"][0]["@type"] == "Movie"
        assert data["jsonld"][0]["name"] == "Test Movie"

    def test_multiple_types_with_movie(self):
        """Test Movie alongside other Schema.org types"""
        html = """
        <html>
        <head>
            <script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@type": "Movie",
                "name": "The Film"
            }
            </script>
            <script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@type": "Article",
                "headline": "Review of The Film"
            }
            </script>
        </head>
        <body></body>
        </html>
        """

        objects = meta_oxide.extract_jsonld(html)

        assert len(objects) == 2
        types = [obj["@type"] for obj in objects]
        assert "Movie" in types
        assert "Article" in types


if __name__ == "__main__":
    pytest.main([__file__, "-v"])