upnp_test.go 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. // Copyright (C) 2014 Jakob Borg and Contributors (see the CONTRIBUTORS file).
  2. //
  3. // This program is free software: you can redistribute it and/or modify it
  4. // under the terms of the GNU General Public License as published by the Free
  5. // Software Foundation, either version 3 of the License, or (at your option)
  6. // any later version.
  7. //
  8. // This program is distributed in the hope that it will be useful, but WITHOUT
  9. // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  10. // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  11. // more details.
  12. //
  13. // You should have received a copy of the GNU General Public License along
  14. // with this program. If not, see <http://www.gnu.org/licenses/>.
  15. package upnp
  16. import (
  17. "os"
  18. "testing"
  19. )
  20. func TestGetTechnicolorRootURL(t *testing.T) {
  21. r, _ := os.Open("testdata/technicolor.xml")
  22. _, action, err := getServiceURLReader("http://localhost:1234/", r)
  23. if err != nil {
  24. t.Fatal(err)
  25. }
  26. if action != "urn:schemas-upnp-org:service:WANPPPConnection:1" {
  27. t.Error("Unexpected action", action)
  28. }
  29. }