fix twitter test data outdated
Some checks failed
Tests / check-build (push) Has been cancelled
Tests / check-unit-tests (push) Has been cancelled
Tests / check-assembly-run (push) Has been cancelled

This commit is contained in:
A.C.Sukazyo Eyre 2025-02-05 01:06:11 +08:00
parent 03fbfc2ff0
commit bd95870864
Signed by: Eyre_S
GPG Key ID: EFB47D98FE082FAD

View File

@ -36,29 +36,70 @@ class FXApiTest extends MornyTests with TableDrivenPropertyChecks {
val examples = Table[(Option[String], String), FXApi =>Unit](
("id", "checking"),
((Some("_Eyre_S"), "1669362743332438019"), api => {
// Due to those tweets owner (Eyre_S) is now private, so the test will fail.
// ((Some("_Eyre_S"), "1669362743332438019"), api => {
// api.code shouldEqual 200
// api.tweet shouldBe defined
// api.tweet.get.text shouldEqual "猫头猫头鹰头猫头鹰头猫头鹰"
// api.tweet.get.quote shouldBe defined
// api.tweet.get.quote.get.id shouldEqual "1669302279386828800"
// }),
// ((None, "1669362743332438019"), api => {
// api.code shouldEqual 200
// api.tweet shouldBe defined
// api.tweet.get.text shouldEqual "猫头猫头鹰头猫头鹰头猫头鹰"
// api.tweet.get.quote shouldBe defined
// api.tweet.get.quote.get.id shouldEqual "1669302279386828800"
// }),
// ((None, "1654080016802807809"), api => {
// api.code shouldEqual 200
// api.tweet shouldBe defined
// api.tweet.get.media shouldBe defined
// api.tweet.get.media.get.videos shouldBe empty
// api.tweet.get.media.get.photos shouldBe defined
// api.tweet.get.media.get.photos.get.length shouldBe 1
// api.tweet.get.media.get.photos.get.head.width shouldBe 2048
// api.tweet.get.media.get.photos.get.head.height shouldBe 1536
// api.tweet.get.media.get.mosaic shouldBe empty
// }),
// https://x.com/_suk_ws/status/1472085698081484800
((Some("_suk_ws"), "1472085698081484800"), api => {
api.code shouldEqual 200
api.tweet shouldBe defined
api.tweet.get.text shouldEqual "猫头猫头鹰头猫头鹰头猫头鹰"
api.tweet.get.quote shouldBe defined
api.tweet.get.quote.get.id shouldEqual "1669302279386828800"
api.tweet.get.text shouldEqual "今年的工房要做年报&^&"
// this tweet is single
api.tweet.get.quote shouldBe empty
}),
((None, "1669362743332438019"), api => {
api.tweet shouldBe defined
api.tweet.get.text shouldEqual "猫头猫头鹰头猫头鹰头猫头鹰"
api.tweet.get.quote shouldBe defined
api.tweet.get.quote.get.id shouldEqual "1669302279386828800"
}),
((None, "1654080016802807809"), api => {
// https://x.com/_suk_ws/status/1463410234504802306
((None, "1463410234504802306"), api => {
api.code shouldEqual 200
api.tweet shouldBe defined
api.tweet.get.text shouldEqual "bread-card-ui 平面拟物&~&"
// this tweet is single
api.tweet.get.quote shouldBe empty
// this tweet has 1 photo and no video, only one media shouldn't be mosaic
api.tweet.get.media shouldBe defined
api.tweet.get.media.get.videos shouldBe empty
api.tweet.get.media.get.photos shouldBe defined
api.tweet.get.media.get.photos.get.length shouldBe 1
api.tweet.get.media.get.photos.get.head.width shouldBe 2048
api.tweet.get.media.get.photos.get.head.height shouldBe 1536
api.tweet.get.media.get.mosaic shouldBe empty
}),
// https://x.com/_suk_ws/status/1463099580149424131
((Some("_suk_ws"), "1463099580149424131"), api => {
api.code shouldEqual 200
api.tweet shouldBe defined
// this tweet has 3 photos and no video. multiple photos will be mosaic
api.tweet.get.media shouldBe defined
api.tweet.get.media.get.videos shouldBe empty
api.tweet.get.media.get.photos shouldBe defined
api.tweet.get.media.get.photos.get.length shouldBe 3
api.tweet.get.media.get.mosaic shouldBe defined
// this tweet has a quote
api.tweet.get.quote shouldBe defined
api.tweet.get.quote.get.id shouldEqual "1463084178023452674"
}),
((None, "1538536152093044736"), api => {
api.code shouldEqual 200
api.tweet shouldBe defined
api.tweet.get.media shouldBe defined
api.tweet.get.media.get.videos shouldBe empty