-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
URNs refactor #738
URNs refactor #738
Conversation
@@ -195,7 +196,7 @@ func (ts *BackendTestSuite) TestDeleteMsgByExternalID() { | |||
func (ts *BackendTestSuite) TestContact() { | |||
knChannel := ts.getChannel("KN", "dbc126ed-66bc-4e28-b67b-81dc3327c95d") | |||
clog := courier.NewChannelLog(courier.ChannelLogTypeUnknown, knChannel, nil) | |||
urn, _ := urns.NewTelURNForCountry("12065551518", "US") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tests like this don't need to call URN parsing functions.. especially if they're not checking for errors
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #738 +/- ##
==========================================
- Coverage 74.61% 74.60% -0.02%
==========================================
Files 110 111 +1
Lines 13284 13293 +9
==========================================
+ Hits 9912 9917 +5
- Misses 2659 2663 +4
Partials 713 713 ☔ View full report in Codecov by Sentry. |
4c1de93
to
1b97543
Compare
@@ -21,10 +21,10 @@ var testChannels = []courier.Channel{ | |||
|
|||
const ( | |||
receiveURL = "/c/mbd/8eb23e93-5ecb-45ba-b726-3b064e0c56ab/receive" | |||
validReceive = `{"receiver":"18005551515","sender":"188885551515","message":"Test again","date":1690386569,"date_utc":1690418969,"reference":"1","id":"b6aae1b5dfb2427a8f7ea6a717ba31a9","message_id":"3b53c137369242138120d6b0b2122607","recipient":"18005551515","originator":"188885551515","body":"Test 3","createdDatetime":"2023-07-27T00:49:29+00:00","mms":false}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tybritten I think you added this handler and I assume 188885551515
is a mistake (too long to be a US number) and there isn't something weird going on I'm not aware of...
@@ -168,7 +135,6 @@ var testCases = []IncomingTestCase{ | |||
{Label: "Receive Attachment", URL: "/c/twt/8eb23e93-5ecb-45ba-b726-3b064e0c568c/receive", Data: attachment, ExpectedRespStatus: 200, ExpectedBodyContains: "Accepted", | |||
ExpectedMsgText: Sp("Hello"), ExpectedAttachments: []string{"https://image.foo.com/image.jpg"}, ExpectedURN: "twitterid:272953809#nicpottier", ExpectedExternalID: "958501034212564996", ExpectedDate: time.Date(2018, 1, 31, 0, 43, 49, 301000000, time.UTC)}, | |||
{Label: "Not JSON", URL: "/c/twt/8eb23e93-5ecb-45ba-b726-3b064e0c568c/receive", Data: notJSON, ExpectedRespStatus: 400, ExpectedBodyContains: "Error"}, | |||
{Label: "Invalid Twitter handle", URL: "/c/twt/8eb23e93-5ecb-45ba-b726-3b064e0c568c/receive", Data: invalidTwitterHandle, ExpectedRespStatus: 400, ExpectedBodyContains: "invalid twitter handle"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this test case is testing if the twitter API gives us an invalid handle.. which then becomes the display part of the URN.. and we're no longer validating the display part of URNs... which I'm fine with because this can't happen
No description provided.