Andrushika commented on code in PR #69965:
URL: https://github.com/apache/airflow/pull/69965#discussion_r3597750523
##########
go-sdk/bundle/bundlev1/registry_test.go:
##########
@@ -66,6 +68,49 @@ func (s *RegistrySuite) TestAddDag_DuplicatePanics() {
})
}
+func (s *RegistrySuite) TestAddDag_AcceptsValidIds() {
+ reg := New()
+ for _, id := range []string{"simple", "with-dash", "with.dot",
"with_underscore", "0numeric", "café_dag", "任務", strings.Repeat("a", 250)} {
+ s.NotPanics(func() { reg.AddDag(id) })
+ }
+}
+
+func (s *RegistrySuite) TestAddDag_InvalidCharsPanic() {
+ for _, id := range []string{"", "with space", "with/slash",
"with:colon", "with\ttab"} {
+ s.PanicsWithError(
+ fmt.Sprintf(
+ "Dag ID %q must be made of alphanumeric
characters, dashes, dots, and underscores",
+ id,
+ ),
+ func() { New().AddDag(id) },
+ )
+ }
+}
+
+func (s *RegistrySuite) TestAddDag_TooLongPanics() {
+ s.PanicsWithError("Dag ID must be less than 250 characters, not 251",
func() {
+ New().AddDag(strings.Repeat("a", 251))
+ })
+}
Review Comment:
Added. Thanks!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]