mirror of
https://github.com/Eyre-S/Coeur-Morny-Cono.git
synced 2025-02-21 21:58:50 +08:00
fix twitter test data outdated
This commit is contained in:
parent
03fbfc2ff0
commit
bd95870864
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user