mirror of
				https://github.com/songquanpeng/one-api.git
				synced 2025-11-04 15:53:42 +08:00 
			
		
		
		
	chore: add ut
This commit is contained in:
		
							
								
								
									
										16
									
								
								relay/adaptor_test.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								relay/adaptor_test.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,16 @@
 | 
				
			|||||||
 | 
					package relay
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import (
 | 
				
			||||||
 | 
						. "github.com/smartystreets/goconvey/convey"
 | 
				
			||||||
 | 
						"github.com/songquanpeng/one-api/relay/apitype"
 | 
				
			||||||
 | 
						"testing"
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func TestGetAdaptor(t *testing.T) {
 | 
				
			||||||
 | 
						Convey("get adaptor", t, func() {
 | 
				
			||||||
 | 
							for i := 0; i < apitype.Dummy; i++ {
 | 
				
			||||||
 | 
								a := GetAdaptor(i)
 | 
				
			||||||
 | 
								So(a, ShouldNotBeNil)
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						})
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										12
									
								
								relay/channeltype/url_test.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								relay/channeltype/url_test.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,12 @@
 | 
				
			|||||||
 | 
					package channeltype
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import (
 | 
				
			||||||
 | 
						. "github.com/smartystreets/goconvey/convey"
 | 
				
			||||||
 | 
						"testing"
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func TestChannelBaseURLs(t *testing.T) {
 | 
				
			||||||
 | 
						Convey("channel base urls", t, func() {
 | 
				
			||||||
 | 
							So(len(ChannelBaseURLs), ShouldEqual, Dummy)
 | 
				
			||||||
 | 
						})
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
		Reference in New Issue
	
	Block a user